Struct CompassBearing
Handling of an bearing that relates to a compass
Implements
Namespace: FpAssistantCore.General
Assembly: FpAssistantCoreScl.dll
Syntax
public struct CompassBearing
Constructors
View SourceCompassBearing(Double)
Initalise compass bearing with a degrees value
Declaration
public CompassBearing(double bearing)
Parameters
Type | Name | Description |
---|---|---|
System.Double | bearing | Value of bearing in degrees in the range 0 to 360 |
Remarks
Degree value will be normalised
Examples
CompassBearing myBearingVar = new CompassBearing(90);
View Source
CompassBearing(Double, AngleUnits)
Initalise compass bearing with a degree or radian value
Declaration
public CompassBearing(double bearing, AngleUnits angleUnit)
Parameters
Type | Name | Description |
---|---|---|
System.Double | bearing | Value of angle |
AngleUnits | angleUnit | Enum defining the unit of the value |
Properties
View SourceBearing
Property to get and set the compass bearing value
Declaration
public double Bearing { get; set; }
Property Value
Type | Description |
---|---|
System.Double | Numerical value of the bearing |
Remarks
Value will be normalised between 0 and less than 360
Methods
View SourceAdd(CompassBearing, CompassBearing)
Operator Addition of two CompassBearing objects
Declaration
public static CompassBearing Add(CompassBearing left, CompassBearing right)
Parameters
Type | Name | Description |
---|---|---|
CompassBearing | left | First operand |
CompassBearing | right | Second operand |
Returns
Type | Description |
---|---|
CompassBearing | Value of Addition |
AngleBetween(CompassBearing)
Calculates the sweep angle between this and the parameter
Declaration
public Angle AngleBetween(CompassBearing compassBearing)
Parameters
Type | Name | Description |
---|---|---|
CompassBearing | compassBearing | Next bearing in a clockwise direction to subtract |
Returns
Type | Description |
---|---|
Angle | Radians value |
Remarks
Calculated in a clockwise direction
AsCartesianAngleDegrees()
conversion of bearing to cartesian angle
Declaration
public Angle AsCartesianAngleDegrees()
Returns
Type | Description |
---|---|
Angle | Cartesian angle in degrees |
Remarks
Angles on a Cartesian Coordinate System begin with 0 degrees to the right, and proceed anticlockwise with 90 degrees up, 180 degrees to the left, and finally 270 degrees downward
AsDegrees()
Compass bearing represented as Degrees
Declaration
public double AsDegrees()
Returns
Type | Description |
---|---|
System.Double | Degrees value |
AsRadians()
Compass bearing represented as Radians
Declaration
public double AsRadians()
Returns
Type | Description |
---|---|
System.Double | Radians value |
Equals(CompassBearing)
Declaration
public bool Equals(CompassBearing other)
Parameters
Type | Name | Description |
---|---|---|
CompassBearing | 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 |
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
Subtract(CompassBearing, CompassBearing)
Operator Subtraction of two CompassBearing objects
Declaration
public static CompassBearing Subtract(CompassBearing left, CompassBearing right)
Parameters
Type | Name | Description |
---|---|---|
CompassBearing | left | First operand |
CompassBearing | right | Second operand |
Returns
Type | Description |
---|---|
CompassBearing | Value of Subtraction |
ToString()
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |
Operators
View SourceAddition(CompassBearing, CompassBearing)
Operator Addition of two CompassBearing objects
Declaration
public static CompassBearing operator +(CompassBearing left, CompassBearing right)
Parameters
Type | Name | Description |
---|---|---|
CompassBearing | left | First operand |
CompassBearing | right | Second operand |
Returns
Type | Description |
---|---|
CompassBearing | Value of Addition |
Addition(CompassBearing, Double)
Operator Addition of a CompassBearing object and double
Declaration
public static CompassBearing operator +(CompassBearing compassBearing, double angleChange)
Parameters
Type | Name | Description |
---|---|---|
CompassBearing | compassBearing | |
System.Double | angleChange |
Returns
Type | Description |
---|---|
CompassBearing | Value of Addition |
Equality(CompassBearing, CompassBearing)
Declaration
public static bool operator ==(CompassBearing a1, CompassBearing a2)
Parameters
Type | Name | Description |
---|---|---|
CompassBearing | a1 | |
CompassBearing | a2 |
Returns
Type | Description |
---|---|
System.Boolean |
Inequality(CompassBearing, CompassBearing)
Declaration
public static bool operator !=(CompassBearing a1, CompassBearing a2)
Parameters
Type | Name | Description |
---|---|---|
CompassBearing | a1 | |
CompassBearing | a2 |
Returns
Type | Description |
---|---|
System.Boolean |
Subtraction(CompassBearing, Angle)
Operator Subtraction of a CompassBearing object and Angle object
Declaration
public static CompassBearing operator -(CompassBearing compassBearing, Angle angle)
Parameters
Type | Name | Description |
---|---|---|
CompassBearing | compassBearing | First operand |
Angle | angle | Second operand |
Returns
Type | Description |
---|---|
CompassBearing | Value of Subtraction |
Subtraction(CompassBearing, CompassBearing)
Operator Subtraction of two CompassBearing objects
Declaration
public static CompassBearing operator -(CompassBearing left, CompassBearing right)
Parameters
Type | Name | Description |
---|---|---|
CompassBearing | left | First operand |
CompassBearing | right | Second operand |
Returns
Type | Description |
---|---|
CompassBearing | Value of Subtraction |
Subtraction(CompassBearing, Double)
Operator Subtraction of a CompassBearing object and double
Declaration
public static CompassBearing operator -(CompassBearing compassBearing, double angleChange)
Parameters
Type | Name | Description |
---|---|---|
CompassBearing | compassBearing | First operand |
System.Double | angleChange | Second operand |
Returns
Type | Description |
---|---|
CompassBearing | Value of Subtraction |