Opening angle of the light cone of a spot light
MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.
MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.
|Mandatory||Real-valued expression (interpreted in radians)|
|Objects||SpotAngle Default Values|
SpotAngle sets the opening angle of the light
cone of a spot light in radians, and defines the opening angle of
the light cone emitted by spot lights of type
The values for
SpotAngle have to be given
in radians. Reasonable value lie between 0 and π.
SpotAngle can be animated.
When creating a spot light, the third argument is the
spotlight := plot::SpotLight([0, 0, 1], [0, 0, 0], a*PI, 1, a = 0..0.4, LightColor = RGB::White): spotlight::SpotAngle
We illuminate the x-y plane by the animated spot light and some ambient light. The spot light is visualized by a cone:
ambientlight := plot::AmbientLight(0.2): s := plot::Surface([x, y, 0], x = -1..1, y = -1..1, Submesh = [2, 2], Color = RGB::White, FillColorType = Flat): c := plot::Cone(0, [0, 0, 1], 0.6*tan(a*PI/2), [0, 0, 1 - 0.6], a = 0..0.4, Color = RGB::Orange.[0.5]): plot(s, c, spotlight, ambientlight, CameraDirection = [-9, -18, 12])
delete spotlight, ambientlight, s, c: