CVB.Net 14.0
Angle Struct Reference

Object for convenient and type-safe handling of angles. More...

Inherits IComparable< Angle >.

Public Member Functions

Angle (bool trim)
Generate a 0° angle. More...

override string ToString ()
Convert the angle to a string. Although Radians is the predominantly used unit for angles, the angle will be output as a degree string as this is easier humanly readable. More...

override bool Equals (object obj)
Equality comparison. More...

override int GetHashCode ()
Hash code generation. More...

int CompareTo (Angle other)
Implementation of the IComparable function More...

Static Public Member Functions

static Angle FromDegrees (double deg, bool trim)
Create an angle in degrees. More...

static Angle FromDegrees (double deg)
Create an angle in degrees. More...

Create an angle in radians. More...

Create an angle in radians. More...

static bool operator< (Angle lhs, Angle rhs)
Comparison of two angles. More...

static bool operator> (Angle lhs, Angle rhs)
Comparison of two angles. More...

static Angle operator+ (Angle lhs, Angle rhs)

static Angle operator- (Angle lhs, Angle rhs)
Subtract two angles. More...

static Angle operator* (double lhs, Angle rhs)
Multiply an angle with a number. More...

static Angle operator/ (Angle lhs, double rhs)
Divide an angle by a number. More...

static Angle operator* (Angle lhs, double rhs)
Multiply an angle with a number. More...

static bool operator== (Angle lhs, Angle rhs)
Compare two angles for equality. More...

static bool operator!= (Angle lhs, Angle rhs)
Compare two angles for inequality. More...

Static Public Attributes

static readonly Angle Zero = new Angle()
Zero element.

Properties

double Deg` [get, set]`
Get/set the value in degrees. Setting this property will automatically update the Rad property accordingly. Also, the value will be trimmed if enabled.

double Rad` [get, set]`
Get/set the value in Radians. Setting this property will automatically update the Deg property accordingly. Also, the value will be trimmed if enabled.

bool IsTrimmed` [get, set]`
Turn trimming of the value of the angle to the range -PI...PI on or off.

Detailed Description

Object for convenient and type-safe handling of angles.

◆ Angle()

 Angle ( bool trim )

Generate a 0° angle.

Parameters
 trim trimming

◆ CompareTo()

 int CompareTo ( Angle other )

Implementation of the IComparable function

Parameters
 other Angle to compare to
Returns
Comparison result (see IComparable documentation)

◆ Equals()

 override bool Equals ( object obj )

Equality comparison.

Parameters
 obj Object to compare to
Returns
`true` if equal; `false` if not.

◆ FromDegrees() [1/2]

 static Angle FromDegrees ( double deg )
static

Create an angle in degrees.

Parameters
 deg Angle value
Returns
A new Angle object representing the input value.

◆ FromDegrees() [2/2]

 static Angle FromDegrees ( double deg, bool trim )
static

Create an angle in degrees.

Parameters
 deg Angle value trim Trimming
Returns
A new Angle object representing the input value.

static

Parameters
Returns
A new Angle object representing the input value.

static

Parameters
Returns
A new Angle object representing the input value.

◆ GetHashCode()

 override int GetHashCode ( )

Hash code generation.

Returns
Hash code as generated by the base class.

◆ operator!=()

 static bool operator!= ( Angle lhs, Angle rhs )
static

Compare two angles for inequality.

Parameters
 lhs Angle rhs Angle
Returns
Result

◆ operator*() [1/2]

 static Angle operator* ( Angle lhs, double rhs )
static

Multiply an angle with a number.

Parameters
 rhs Number lhs Angle
Returns
Result

◆ operator*() [2/2]

 static Angle operator* ( double lhs, Angle rhs )
static

Multiply an angle with a number.

Parameters
 lhs Number rhs Angle
Returns
Result

◆ operator+()

 static Angle operator+ ( Angle lhs, Angle rhs )
static

Parameters
 lhs Angle rhs Angle
Returns
Result

◆ operator-()

 static Angle operator- ( Angle lhs, Angle rhs )
static

Subtract two angles.

Parameters
 lhs Angle rhs Angle
Returns
Result

◆ operator/()

 static Angle operator/ ( Angle lhs, double rhs )
static

Divide an angle by a number.

Parameters
 lhs Angle rhs Number
Returns
Result

◆ operator<()

 static bool operator< ( Angle lhs, Angle rhs )
static

Comparison of two angles.

Parameters
 lhs Angle rhs Angle
Returns
`true` if lhs is bigger than rhs , `false` otherwise

◆ operator==()

 static bool operator== ( Angle lhs, Angle rhs )
static

Compare two angles for equality.

Parameters
 lhs Angle rhs Angle
Returns
Result

◆ operator>()

 static bool operator> ( Angle lhs, Angle rhs )
static

Comparison of two angles.

Parameters
 lhs Angle rhs Angle
Returns
`true` if lhs is bigger than rhs , `false` otherwise

◆ ToString()

 override string ToString ( )

Convert the angle to a string. Although Radians is the predominantly used unit for angles, the angle will be output as a degree string as this is easier humanly readable.

Returns
String representation.