Show / Hide Table of Contents

Struct CompassBearing

Handling of an bearing type that relates to a compass

Implements
System.IEquatable<CompassBearing>
Namespace: FpAssistantCore.General
Assembly: FpAssistantCoreScl.dll
Syntax
public struct CompassBearing

Constructors

View Source

CompassBearing(Double)

Initialise 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)

Initialise 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 Source

Bearing

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 Source

Add(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

View Source

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

View Source

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

View Source

AsDegrees()

Compass bearing represented as Degrees

Declaration
public double AsDegrees()
Returns
Type Description
System.Double

Degrees value

View Source

AsRadians()

Compass bearing represented as Radians

Declaration
public double AsRadians()
Returns
Type Description
System.Double

Radians value

View Source

Equals(CompassBearing)

Declaration
public bool Equals(CompassBearing other)
Parameters
Type Name Description
CompassBearing other
Returns
Type Description
System.Boolean
View Source

Equals(Object)

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
System.Object obj
Returns
Type Description
System.Boolean
View Source

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32
View Source

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

View Source

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

View Source

ToString()

ToString()

Declaration
public override string ToString()
Returns
Type Description
System.String

Operators

View Source

Addition(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

View Source

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

View Source

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
View Source

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
View Source

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

View Source

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

View Source

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

Implements

System.IEquatable<>
  • View Source
In This Article
Back to top Copyright 2018-2024 CADology Limited