Struct Angle
Handling of an angle object, Degrees and Radians supported
Implements
Namespace: FpAssistantCore.General
Assembly: FpAssistantCoreScl.dll
Syntax
public struct Angle
Constructors
View SourceAngle(Double)
Initalise angle with a degree value
Declaration
public Angle(double degrees)
Parameters
Type | Name | Description |
---|---|---|
System.Double | degrees | Value of angle in degrees |
Remarks
Degree value will be normalised
Examples
Angle myAngleVar = new Angle(90);
View Source
Angle(Double, AngleUnits)
Initalise angle with a degree or radian value
Declaration
public Angle(double angleValue, AngleUnits angleUnit)
Parameters
Type | Name | Description |
---|---|---|
System.Double | angleValue | Value of angle |
AngleUnits | angleUnit | Enum defining the unit of the value |
Angle(Int32, Int32, Double)
Initalise angle with degrees. minutes and seconds
Declaration
public Angle(int degrees, int minutes, double seconds)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | degrees | Value of degrees |
System.Int32 | minutes | Value of minutes |
System.Double | seconds | Value of seconds |
Remarks
Degree value will be normalised
Properties
View SourceTotalSeconds
Gets the value of the current Angle structure expressed in whole and fractional seconds
Declaration
public readonly double TotalSeconds { get; }
Property Value
Type | Description |
---|---|
System.Double | Total number of seconds |
Methods
View SourceAsCompassBearing()
Angle represented as a bearing on a compass
Declaration
public CompassBearing AsCompassBearing()
Returns
Type | Description |
---|---|
CompassBearing | Compass bearing value |
AsDegrees()
Angle represented as Degrees
Declaration
public double AsDegrees()
Returns
Type | Description |
---|---|
System.Double | Degrees value |
AsRadians()
Angle represented as Radians
Declaration
public double AsRadians()
Returns
Type | Description |
---|---|
System.Double | Radians value |
CartesianToCompassDegrees(Double)
Convert cartesian angle to compass bearing - Degrees
Declaration
public static double CartesianToCompassDegrees(double angleDegrees)
Parameters
Type | Name | Description |
---|---|---|
System.Double | angleDegrees | Value of angle in degrees |
Returns
Type | Description |
---|---|
System.Double |
CartesianToCompassRadians(Double)
Convert cartesian angle to compass bearing - Radians
Declaration
public static double CartesianToCompassRadians(double angleRadians)
Parameters
Type | Name | Description |
---|---|---|
System.Double | angleRadians | Value of angle in radians |
Returns
Type | Description |
---|---|
System.Double |
CompassToCartesianDegrees(Double)
Convert compass bearing to cartesian angle - Degrees
Declaration
public static double CompassToCartesianDegrees(double angleDegrees)
Parameters
Type | Name | Description |
---|---|---|
System.Double | angleDegrees | Value of angle in degrees |
Returns
Type | Description |
---|---|
System.Double |
CompassToCartesianRadians(Double)
Convert compass bearing to cartesian angle - Radians
Declaration
public static double CompassToCartesianRadians(double angleRadians)
Parameters
Type | Name | Description |
---|---|---|
System.Double | angleRadians | Value of angle in radians |
Returns
Type | Description |
---|---|
System.Double |
DegreesToRadians(Double)
Function to return radians from a degrees value
Declaration
public static double DegreesToRadians(double degrees)
Parameters
Type | Name | Description |
---|---|---|
System.Double | degrees | Value of degrees to be converted to radians |
Returns
Type | Description |
---|---|
System.Double | Radians value |
Remarks
Static Function
Equals(Angle)
Declaration
public bool Equals(Angle other)
Parameters
Type | Name | Description |
---|---|---|
Angle | other |
Returns
Type | Description |
---|---|
System.Boolean |
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj |
Returns
Type | Description |
---|---|
System.Boolean |
FromDegrees(Double)
Function to return an Angle type from a degrees value
Declaration
public static Angle FromDegrees(double degrees)
Parameters
Type | Name | Description |
---|---|---|
System.Double | degrees | Value of degrees to be normalized |
Returns
Type | Description |
---|---|
Angle | Degrees value in Angle type |
Remarks
Static Function
FromRadians(Double)
Function to return an Angle type from a radians value
Declaration
public static Angle FromRadians(double radians)
Parameters
Type | Name | Description |
---|---|---|
System.Double | radians | Value of radians |
Returns
Type | Description |
---|---|
Angle | Degrees value in Angle type |
Remarks
Static Function
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
Normalize(Double)
Normalize degree value to ensure valid range
Declaration
public static double Normalize(double degrees)
Parameters
Type | Name | Description |
---|---|---|
System.Double | degrees | Value of degrees to be normalized |
Returns
Type | Description |
---|---|
System.Double | Normalized degrees value |
Remarks
Static Function
RadiansToDegrees(Double)
Function to return degrees from a radians value
Declaration
public static double RadiansToDegrees(double radians)
Parameters
Type | Name | Description |
---|---|---|
System.Double | radians | Value of radians to be converted to degrees |
Returns
Type | Description |
---|---|
System.Double | Degrees value |
Remarks
Static Function
Operators
View SourceEquality(Angle, Angle)
Declaration
public static bool operator ==(Angle a1, Angle a2)
Parameters
Type | Name | Description |
---|---|---|
Angle | a1 | |
Angle | a2 |
Returns
Type | Description |
---|---|
System.Boolean |
Implicit(Angle to Double)
Declaration
public static implicit operator double (Angle angle)
Parameters
Type | Name | Description |
---|---|---|
Angle | angle |
Returns
Type | Description |
---|---|
System.Double |
Implicit(Double to Angle)
Declaration
public static implicit operator Angle(double degrees)
Parameters
Type | Name | Description |
---|---|---|
System.Double | degrees |
Returns
Type | Description |
---|---|
Angle |
Inequality(Angle, Angle)
Declaration
public static bool operator !=(Angle a1, Angle a2)
Parameters
Type | Name | Description |
---|---|---|
Angle | a1 | |
Angle | a2 |
Returns
Type | Description |
---|---|
System.Boolean |