SpotLight Class

A light at a point, that shines toward another point: feSpotLight of SVG.

public sealed class SpotLight : FilterLightSource

Remarks

The light is the one of a PointLight, multiplied by max(-L.S, 0)^SpecularExponent, with L the unit vector toward the light and S the unit vector from the light to the point it shines at; outside SpotLight.LimitingConeAngle, where -L.S is less than the cosine of that angle, there is no light.

Inheritance
FilterLightSource SpotLight

Constructors

NameDescription
SpotLight(double, double, double, double, double, double)Initializes a new instance of the SpotLight class.

SpotLight(double, double, double, double, double, double)

SpotLight.cs

Initializes a new instance of the SpotLight class.

public SpotLight(double x, double y, double z, double pointsAtX, double pointsAtY, double pointsAtZ)

Parameters

x double
The x of the light, in the drawing.
y double
The y of the light, in the drawing.
z double
The height of the light above the plane, in units of the drawing.
pointsAtX double
The x of the point the light shines at: pointsAtX.
pointsAtY double
The y of the point the light shines at.
pointsAtZ double
The height of the point the light shines at.

Exceptions

ArgumentException
A coordinate is not a finite number.
ArgumentOutOfRangeException
The magnitude of a coordinate exceeds 16777216.

Properties

NameDescription
LimitingConeAngleGets the angle between the axis of the light and the edge of its cone, in degrees, or null (the default) for no cone: limitingConeAngle.
PointsAtXGets the x of the point the light shines at.
PointsAtYGets the y of the point the light shines at.
PointsAtZGets the height of the point the light shines at.
SpecularExponentGets how fast the light fades away from its axis: specularExponent. Defaults to 1.
XGets the x of the light.
YGets the y of the light.
ZGets the height of the light above the plane.

LimitingConeAngle

SpotLight.cs

Gets the angle between the axis of the light and the edge of its cone, in degrees, or null (the default) for no cone: limitingConeAngle.

public double? LimitingConeAngle { get; init; }

Property value

double?

Exceptions

ArgumentException
The value is not a finite number.

PointsAtX

SpotLight.cs

Gets the x of the point the light shines at.

public double PointsAtX { get; }

Property value

double

PointsAtY

SpotLight.cs

Gets the y of the point the light shines at.

public double PointsAtY { get; }

Property value

double

PointsAtZ

SpotLight.cs

Gets the height of the point the light shines at.

public double PointsAtZ { get; }

Property value

double

SpecularExponent

SpotLight.cs

Gets how fast the light fades away from its axis: specularExponent. Defaults to 1.

public double SpecularExponent { get; init; }

Property value

double

Exceptions

ArgumentException
The value is not a finite number.
ArgumentOutOfRangeException
The value is negative or exceeds 128.

Gets the x of the light.

public double X { get; }

Property value

double

Gets the y of the light.

public double Y { get; }

Property value

double

Gets the height of the light above the plane.

public double Z { get; }

Property value

double