Struct Angle
Handling of an angle type, Degrees and Radians supported
Implements
Inherited Members
Namespace: FpAssistantCore.General
Assembly: FpAssistantCoreScl.dll
Syntax
public struct Angle : IEquatable<Angle>
Constructors
View SourceAngle(double)
Initialise angle with a degree value
Declaration
public Angle(double degrees)
Parameters
Type | Name | Description |
---|---|---|
double | degrees | Value of angle in degrees |
Remarks
Degree value will be normalised
Examples
Angle myAngleVar = new Angle(90);
View Source
Angle(double, AngleUnits)
Initialise angle with a degree or radian value
Declaration
public Angle(double angleValue, AngleUnits angleUnit)
Parameters
Type | Name | Description |
---|---|---|
double | angleValue | Value of angle |
AngleUnits | angleUnit | Enum defining the unit of the value |
Angle(int, int, double)
Initialise angle with degrees. minutes and seconds
Declaration
public Angle(int degrees, int minutes, double seconds)
Parameters
Type | Name | Description |
---|---|---|
int | degrees | Value of degrees |
int | minutes | Value of minutes |
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 double TotalSeconds { get; }
Property Value
Type | Description |
---|---|
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 |
---|---|
double | Degrees value |
AsRadians()
Angle represented as Radians
Declaration
public double AsRadians()
Returns
Type | Description |
---|---|
double | Radians value |
CartesianToCompassDegrees(double)
Convert cartesian angle to compass bearing - Degrees
Declaration
public static double CartesianToCompassDegrees(double angleDegrees)
Parameters
Type | Name | Description |
---|---|---|
double | angleDegrees | Value of angle in degrees |
Returns
Type | Description |
---|---|
double |
CartesianToCompassRadians(double)
Convert cartesian angle to compass bearing - Radians
Declaration
public static double CartesianToCompassRadians(double angleRadians)
Parameters
Type | Name | Description |
---|---|---|
double | angleRadians | Value of angle in radians |
Returns
Type | Description |
---|---|
double |
CompassToCartesianDegrees(double)
Convert compass bearing to cartesian angle - Degrees
Declaration
public static double CompassToCartesianDegrees(double angleDegrees)
Parameters
Type | Name | Description |
---|---|---|
double | angleDegrees | Value of angle in degrees |
Returns
Type | Description |
---|---|
double |
CompassToCartesianRadians(double)
Convert compass bearing to cartesian angle - Radians
Declaration
public static double CompassToCartesianRadians(double angleRadians)
Parameters
Type | Name | Description |
---|---|---|
double | angleRadians | Value of angle in radians |
Returns
Type | Description |
---|---|
double |
DegreesToRadians(double)
Function to return radians from a degrees value
Declaration
public static double DegreesToRadians(double degrees)
Parameters
Type | Name | Description |
---|---|---|
double | degrees | Value of degrees to be converted to radians |
Returns
Type | Description |
---|---|
double | Radians value |
Remarks
Static Function
Equals(Angle)
Declaration
public bool Equals(Angle other)
Parameters
Type | Name | Description |
---|---|---|
Angle | other |
Returns
Type | Description |
---|---|
bool |
Equals(object)
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj |
Returns
Type | Description |
---|---|
bool |
Overrides
View SourceFromDegrees(double)
Function to return an Angle type from a degrees value
Declaration
public static Angle FromDegrees(double degrees)
Parameters
Type | Name | Description |
---|---|---|
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 |
---|---|---|
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 |
---|---|
int |
Overrides
View SourceNormalize(double)
Normalize degree value to ensure valid range
Declaration
public static double Normalize(double degrees)
Parameters
Type | Name | Description |
---|---|---|
double | degrees | Value of degrees to be normalized |
Returns
Type | Description |
---|---|
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 |
---|---|---|
double | radians | Value of radians to be converted to degrees |
Returns
Type | Description |
---|---|
double | Degrees value |
Remarks
Static Function
Operators
View Sourceoperator ==(Angle, Angle)
Declaration
public static bool operator ==(Angle a1, Angle a2)
Parameters
Type | Name | Description |
---|---|---|
Angle | a1 | |
Angle | a2 |
Returns
Type | Description |
---|---|
bool |
implicit operator double(Angle)
Declaration
public static implicit operator double(Angle angle)
Parameters
Type | Name | Description |
---|---|---|
Angle | angle |
Returns
Type | Description |
---|---|
double |
implicit operator Angle(double)
Declaration
public static implicit operator Angle(double degrees)
Parameters
Type | Name | Description |
---|---|---|
double | degrees |
Returns
Type | Description |
---|---|
Angle |
operator !=(Angle, Angle)
Declaration
public static bool operator !=(Angle a1, Angle a2)
Parameters
Type | Name | Description |
---|---|---|
Angle | a1 | |
Angle | a2 |
Returns
Type | Description |
---|---|
bool |