Struct CompassBearing
Handling of an bearing type that relates to a compass
Implements
Inherited Members
Namespace: FpAssistantCore.General
Assembly: FpAssistantCoreScl.dll
Syntax
public struct CompassBearing : IEquatable<CompassBearing>
Constructors
View SourceCompassBearing(double)
Initialise compass bearing with a degrees value
Declaration
public CompassBearing(double bearing)
Parameters
| Type | Name | Description |
|---|---|---|
| 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)
Initialise compass bearing with a degree or radian value
Declaration
public CompassBearing(double bearing, AngleUnits angleUnit)
Parameters
| Type | Name | Description |
|---|---|---|
| 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 |
|---|---|
| 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 |
|---|---|
| double | Degrees value |
AsRadians()
Compass bearing represented as Radians
Declaration
public double AsRadians()
Returns
| Type | Description |
|---|---|
| double | Radians value |
Equals(CompassBearing)
Declaration
public bool Equals(CompassBearing other)
Parameters
| Type | Name | Description |
|---|---|---|
| CompassBearing | 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 SourceGetHashCode()
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
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 |
|---|---|
| string |
Overrides
Operators
View Sourceoperator +(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 |
operator +(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 | |
| double | angleChange |
Returns
| Type | Description |
|---|---|
| CompassBearing | Value of Addition |
operator ==(CompassBearing, CompassBearing)
Declaration
public static bool operator ==(CompassBearing a1, CompassBearing a2)
Parameters
| Type | Name | Description |
|---|---|---|
| CompassBearing | a1 | |
| CompassBearing | a2 |
Returns
| Type | Description |
|---|---|
| bool |
operator !=(CompassBearing, CompassBearing)
Declaration
public static bool operator !=(CompassBearing a1, CompassBearing a2)
Parameters
| Type | Name | Description |
|---|---|---|
| CompassBearing | a1 | |
| CompassBearing | a2 |
Returns
| Type | Description |
|---|---|
| bool |
operator -(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 |
operator -(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 |
operator -(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 |
| double | angleChange | Second operand |
Returns
| Type | Description |
|---|---|
| CompassBearing | Value of Subtraction |