[DebuggerDisplay("{ToString()}")] [IoId("00000000-51B5-482E-A9CD-E356B78383D0")] public struct Angle : IStorable, IEquatable<Angle>, IComparable<Angle>
A type useful for storing angles. This type is basically a double with some added knowledge about what kind of angle it represents.

Constructors

Angle

#
public Angle(double angle, AngleKind kind)
angle (double)
kind (AngleKind)

Angle

#
public Angle(IReader reader)
Deserialisation constructor.
reader (IReader)

Properties

Degrees

#
public double Degrees { get; }
Gets the angle value in Degrees.

Full

#
public static Angle Full { get; }
Gets a full turn degree angle.

Grade

#
public double Grade { get; }
Gets the angle value as a grade percentage.

Kind

#
public AngleKind Kind { get; }
Gets whether this angle is originally defined in radians.

Radians

#
public double Radians { get; }
Gets the angle value in Radians.

Reduced

#
public Angle Reduced { get; }
Gets the simplified angle with all full turns removed.

Reflex

#
public Angle Reflex { get; }
Gets the reflex angle to this one.

Spread

#
public double Spread { get; }
Gets the spread value of this angle.

Turns

#
public double Turns { get; }
Gets the angle value in Degrees.

Zero

#
public static Angle Zero { get; }
Gets a zero degree angle.

Methods

CompareTo

#
public int CompareTo(Angle other)
other (Angle)

Equals

#
public bool Equals(Angle other, bool strict)
other (Angle)
strict (bool)

Equals

#
public bool Equals(Angle other)
other (Angle)

Equals

#
public override bool Equals(object obj)
obj (object)
ValueType.Equals

ExtrinsicMean

#
public static Angle ExtrinsicMean(params Angle[] angles)
Compute the extrinsic mean of a set of angles.
angles (params Angle[])Angles to average.
Extrinsic mean, or an invalid angle if there is no average.

FromDegrees

#
public static Angle FromDegrees(double angle)
Create a new angle in degrees.
angle (double)Degrees.
Angle data.

FromRadians

#
public static Angle FromRadians(double angle)
Create a new angle in radians.
angle (double)Radians.
Angle data.

FromSeximal

#
public static Angle FromSeximal(double angle)
Create a new angle in seximal degrees.
angle (double)Degrees.
Angle data.

FromSeximal

#
public static Angle FromSeximal(int degrees, int arcminutes, int arcseconds)
Create a new angle in seximal degrees.
degrees (int)Whole number of degrees.
arcminutes (int)Number of arcminutes.
arcseconds (int)Number of arcseconds.
Angle data.

FromSlope

#
public static Angle FromSlope(double grade)
Create a new angle using a grade percentage.
grade (double)Grade percentage.
Angle data.

FromSlope

#
public static Angle FromSlope(double run, double rise)
Create a new angle using slope characteristics.
run (double)Horizontal distance travelled.
rise (double)Vertical difference between start and end.
Angle data.

FromSpread

#
public static Angle FromSpread(double spread)
Create a new rational trigonometry spread.
spread (double)Spread value.
Angle data.

FromSpread

#
public static Angle FromSpread(double verticalQuadrance, double diagonalQuadrance)
Create a new rational trigonometry spread.
verticalQuadrance (double)Quadrance of the vertical of a right angled triangle.
diagonalQuadrance (double)Quadrance of the diagonal of a right angled triangle.
Angle data.

FromTurns

#
public static Angle FromTurns(double turns)
Create a new angle using turns.
turns (double)Total turns.
Angle data.

GetHashCode

#
public override int GetHashCode()
Explicit

IStorable.Store

#
void IStorable.Store(IWriter writer)
writer (IWriter)
Store

IntrinsicMean

#
public static Angle IntrinsicMean(params Angle[] angles)
Compute the extrinsic mean of a set of angles.
angles (params Angle[])Angles to average.
Intrinsit mean, or an invalid angle if there is no average.

MatchUnit

#
public static Angle MatchUnit(Angle angle, AngleKind unitKind)
Convert an angle into a different unit. Note that since different units have different gamuts, not all conversions are possible.
angle (Angle)
unitKind (AngleKind)

MostCommonKind

#
public static AngleKind MostCommonKind(IEnumerable<Angle> angles)
Determine the most common angle kind in a list.
angles (IEnumerable<Angle>)

MostCommonKind

#
public static AngleKind MostCommonKind(params Angle[] angles)
Gets the angle kind which best covers all provided angles.
angles (params Angle[])

ReduceToFull

#
public Angle ReduceToFull()
Reduce this angle to be within the (0, 2pi) or (0, 360) range.
Reduced angle, may be of different kind than the original.

ReduceToHalf

#
public Angle ReduceToHalf()
Reduce this angle to be within the [-pi,+pi] or [-180,+180] range.
Reduced angle, may be of different kind than the original.

ToSeximalValues

#
public static void ToSeximalValues(double angle, out int degrees, out int minutes, out int seconds, out double fractionalSeconds)
Convert an angle in degrees into seximal parts. Note that this method always returns the parts of the absolute value. Correct handling of negative angles is the responsibility of the caller.
angle (double)Decimal angle in degrees.
degrees (out int)Whole number of degrees.
minutes (out int)Whole number of minutes.
seconds (out int)Whole number of seconds.
fractionalSeconds (out double)Fractional remainder of seconds.

ToString

#
public override string ToString()
Format the angle using the appropriate Kind notation.
String.

TryParse

#
public static bool TryParse(string text, out Angle angle)
Attempt to parse a string. Strings without angle kind hints are assumed to represent degree angles.
text (string)String to parse.
angle (out Angle)Resulting angle.
Success indicator.

Operators

OperationResultDescription
Angle+AngleAngleAdd two angles together.
Angle/doubleAngleDivide an angle by a factor.
Angle/intAngleDivide an angle by a factor.
Angle*doubleAngleMultiply an angle by a factor.
Angle*intAngleMultiply an angle by a factor.
double*AngleAngleMultiply an angle by a factor.
int*AngleAngleMultiply an angle by a factor.
Angle-AngleAngleSubtract one angle from another.
-AngleAngleNegation operator for angle.
+AngleAngleIdentity operator for angle.