angle
struct angleAvailable without an import.
An angular measurement stored as radians. Use suffixes such as 45.degrees or 1.0f.radians to state the unit explicitly. Rotation APIs accept this type instead of an ambiguous raw number.
Members
radsfield
public float radsThe raw float value in radians, without normalization.
constructorconstructor
public constructor (float rads)Stores a raw angle in radians without normalization.
FromRadiansconstructor
public constructor FromRadians (float rads)Constructs from radians without normalization.
FromDegreesconstructor
public constructor FromDegrees (float degrees)Converts degrees to float radians without normalization.
FromTurnsconstructor
public constructor FromTurns (float turns)Converts revolutions to float radians without normalization.
Zerogetter
public static get Zero() : angleZero radians.
FullTurngetter
public static get FullTurn() : angleOne revolution, approximately 2*pi radians.
HalfTurngetter
public static get HalfTurn() : angleHalf a revolution, approximately pi radians.
QuarterTurngetter
public static get QuarterTurn() : angleOne quarter revolution, approximately pi/2 radians.
ToRadiansmethod
public fn ToRadians() : floatReturns the stored radians.
ToDegreesmethod
public fn ToDegrees() : floatConverts the stored radians to degrees without normalization.
ToTurnsmethod
public fn ToTurns() : floatConverts the stored radians to revolutions without normalization.
Sinmethod
public fn Sin() : floatReturns the sine of this angle.
Cosmethod
public fn Cos() : floatReturns the cosine of this angle.
Tanmethod
public fn Tan() : floatReturns the tangent of this angle.
Asinmethod
public static fn Asin(float value) : angleReturns inverse sine as an angle; inputs outside [-1, 1] produce a NaN angle.
Acosmethod
public static fn Acos(float value) : angleReturns inverse cosine as an angle; inputs outside [-1, 1] produce a NaN angle.
Atanmethod
public static fn Atan(float value) : angleReturns inverse tangent as an angle.
Atan2method
public static fn Atan2(float y, float x) : angleReturns the angle of (x, y), using both signs to determine the quadrant.
Lerpmethod
public static fn Lerp(angle a, angle b, float t) : angleInterpolates along the shortest signed arc from a toward b. Does not clamp t; the result is not normalized.
LerpUnclampedmethod
public static fn LerpUnclamped(angle a, angle b, float t) : angleInterpolates along the shortest signed arc without clamping t or normalizing the result. Has
the same behavior as Lerp.
MoveTowardsmethod
public static fn MoveTowards(angle current, angle target, float maxDelta) : angleMoves along the shortest signed arc by at most maxDelta radians. Supply a nonnegative delta; the returned angle is not normalized.
Betweenmethod
public static fn Between(angle a, angle b) : angleReturns the shortest signed rotation from a to b in [-pi, pi]. An exact half-turn retains the sign of the reduced difference.
Normalizemethod
public fn Normalize() : angleReduces finite angles to [0, 2*pi). Nonfinite values produce NaN.
NormalizeSignedmethod
public fn NormalizeSigned() : angleReduces finite angles to [-pi, pi], retaining either endpoint for exact half-turns. Nonfinite values produce NaN.
IsZeromethod
public fn IsZero() : boolTests whether the stored radians are exactly zero, not whether the angle is a whole number of revolutions.
GetHashCodemethod
public fn GetHashCode() : uint32Hashes stored radians, treating all NaNs alike and both signed zeros alike. Whole-turn-equivalent angles need not hash alike.
ToStringmethod
public fn ToString() : stringFormats the angle in degrees followed by the degree symbol, without normalization.
ToStringBuffermethod
public fn ToStringBuffer(StringBuilder builder) : int32Appends the degree representation and returns the number of UTF-8 bytes appended.
Equalsmethod
public fn Equals(angle other) : boolCompares stored radians without normalization. NaNs compare equal to each other and signed zeros compare equal.
CompareTomethod
public fn CompareTo(angle other) : int32Orders stored radians without normalization, returning -1, 0, or 1. NaNs sort last and compare equal to each other.