EsbDecimals - a Free Subset of ESBPCS for .NET

DecimalOps.AdjustAngleDeg Method (Decimal, Boolean)

Adjust the Angle so that it lies between -180 (exclusive) and 180 (inclusive) if posAngle is False, or between 0 (inclusive) and 360 (exclusive) if posAngle is True. Works in Degrees.

[Visual Basic]
Overloads Public Shared Function AdjustAngleDeg( _
   ByVal angleInDegrees As Decimal, _
   ByVal posAngle As Boolean _
) As Decimal
[C#]
public static decimal AdjustAngleDeg(
   decimal angleInDegrees,
   bool posAngle
);

Parameters

angleInDegrees
Angle in Degrees
posAngle
When true the Angle returned is Positive, ie between 0 and 360, when false then the Angle is between -180 and 180.

Return Value

Adjusted Angle in Degrees

See Also

DecimalOps Class | Esb.Math Namespace | DecimalOps.AdjustAngleDeg Overload List