Table of Contents

Struct AngleSingle

Namespace
Stride.Core.Mathematics
Assembly
Stride.Core.Mathematics.dll

Represents a unit independant angle using a single-precision floating-point internal representation.

[DataStyle(DataStyle.Compact)]
[DataContract]
public struct AngleSingle : IComparable, IComparable<AngleSingle>, IEquatable<AngleSingle>, IFormattable
Implements

Constructors

AngleSingle(float, AngleType)

Initializes a new instance of the AngleSingle struct with the given unit dependant angle and unit type.

public AngleSingle(float angle, AngleType type)

Parameters

angle float

A unit dependant measure of the angle.

type AngleType

The type of unit the angle argument is.

AngleSingle(float, float)

Initializes a new instance of the AngleSingle struct using the arc length formula (θ = s/r).

public AngleSingle(float arcLength, float radius)

Parameters

arcLength float

The measure of the arc.

radius float

The radius of the circle.

Fields

Degree

A value that specifies the size of a single degree.

public const float Degree = 0.0027777778

Field Value

float

Gradian

A value that specifies the size of a single gradian.

public const float Gradian = 0.0025

Field Value

float

Milliradian

A value that specifies the size of a single milliradian.

public const float Milliradian = 0.00015915494

Field Value

float

Minute

A value that specifies the size of a single minute.

public const float Minute = 4.6296296E-05

Field Value

float

Radian

A value that specifies the size of a single radian.

public const float Radian = 0.15915494

Field Value

float

Second

A value that specifies the size of a single second.

public const float Second = 7.7160496E-07

Field Value

float

Properties

Complement

Gets a Stride.Core.Mathematics.AngleSingle instance that complements this angle (i.e. the two angles add to 90°).

public AngleSingle Complement { get; }

Property Value

AngleSingle

Degrees

Gets or sets the total number of degrees this Stride.Core.Mathematics.AngleSingle represents.

public float Degrees { get; set; }

Property Value

float

FullRotationAngle

Gets a new Stride.Core.Mathematics.AngleSingle instance that represents the full rotation angle (i.e. 360° or 2π).

public static AngleSingle FullRotationAngle { get; }

Property Value

AngleSingle

Gradians

Gets or sets the total number of gradians this Stride.Core.Mathematics.AngleSingle represents.

public float Gradians { get; set; }

Property Value

float

IsAcute

Gets a System.Boolean that determines whether this Stride.Core.Mathematics.Angle is an acute angle (i.e. less than 90° but greater than 0°).

public bool IsAcute { get; }

Property Value

bool

IsFullRotation

Gets a System.Boolean that determines whether this Stride.Core.Mathematics.Angle is a full rotation angle (i.e. 360° or 2π).

public bool IsFullRotation { get; }

Property Value

bool

IsOblique

Gets a System.Boolean that determines whether this Stride.Core.Mathematics.Angle is an oblique angle (i.e. is not 90° or a multiple of 90°).

public bool IsOblique { get; }

Property Value

bool

IsObtuse

Gets a System.Boolean that determines whether this Stride.Core.Mathematics.Angle is an obtuse angle (i.e. greater than 90° but less than 180°).

public bool IsObtuse { get; }

Property Value

bool

IsReflex

Gets a System.Boolean that determines whether this Stride.Core.Mathematics.Angle is a reflex angle (i.e. greater than 180° but less than 360°).

public bool IsReflex { get; }

Property Value

bool

IsRight

Gets a System.Boolean that determines whether this Stride.Core.Mathematics.Angle is a right angle (i.e. 90° or π/2).

public bool IsRight { get; }

Property Value

bool

IsStraight

Gets a System.Boolean that determines whether this Stride.Core.Mathematics.Angle is a straight angle (i.e. 180° or π).

public bool IsStraight { get; }

Property Value

bool

Milliradians

Gets or sets the total number of milliradians this Stride.Core.Mathematics.AngleSingle represents. One milliradian is equal to 1/(2000π).

public float Milliradians { get; set; }

Property Value

float

Minutes

Gets or sets the minutes component of the degrees this Stride.Core.Mathematics.AngleSingle represents. When setting the minutes, if the value is in the range (-60, 60) the whole degrees are not changed; otherwise, the whole degrees may be changed. Fractional values may set the seconds component.

public float Minutes { get; set; }

Property Value

float

Radians

Gets or sets the total number of radians this Stride.Core.Mathematics.AngleSingle represents.

public float Radians { get; set; }

Property Value

float

Revolutions

Gets or sets the total number of revolutions this Stride.Core.Mathematics.AngleSingle represents.

public float Revolutions { get; set; }

Property Value

float

RightAngle

Gets a new Stride.Core.Mathematics.AngleSingle instance that represents the right angle (i.e. 90° or π/2).

public static AngleSingle RightAngle { get; }

Property Value

AngleSingle

Seconds

Gets or sets the seconds of the degrees this Stride.Core.Mathematics.AngleSingle represents. When setting te seconds, if the value is in the range (-60, 60) the whole minutes or whole degrees are not changed; otherwise, the whole minutes or whole degrees may be changed.

public float Seconds { get; set; }

Property Value

float

StraightAngle

Gets a new Stride.Core.Mathematics.AngleSingle instance that represents the straight angle (i.e. 180° or π).

public static AngleSingle StraightAngle { get; }

Property Value

AngleSingle

Supplement

Gets a Stride.Core.Mathematics.AngleSingle instance that supplements this angle (i.e. the two angles add to 180°).

public AngleSingle Supplement { get; }

Property Value

AngleSingle

ZeroAngle

Gets a new Stride.Core.Mathematics.AngleSingle instance that represents the zero angle (i.e. 0°).

public static AngleSingle ZeroAngle { get; }

Property Value

AngleSingle

Methods

Add(AngleSingle, AngleSingle)

Adds two Stride.Core.Mathematics.AngleSingle objects and returns the result.

public static AngleSingle Add(AngleSingle left, AngleSingle right)

Parameters

left AngleSingle

The first object to add.

right AngleSingle

The second object to add.

Returns

AngleSingle

The value of the two objects added together.

CompareTo(AngleSingle)

Compares this instance to a second Stride.Core.Mathematics.AngleSingle and returns an integer that indicates whether the value of this instance is less than, equal to, or greater than the value of the specified object.

public int CompareTo(AngleSingle other)

Parameters

other AngleSingle

The object to compare.

Returns

int

A signed integer that indicates the relationship of the current instance to the obj parameter. If the value is less than zero, the current instance is less than the other. If the value is zero, the current instance is equal to the other. If the value is greater than zero, the current instance is greater than the other.

CompareTo(object)

Compares this instance to a specified object and returns an integer that indicates whether the value of this instance is less than, equal to, or greater than the value of the specified object.

public int CompareTo(object other)

Parameters

other object

The object to compare.

Returns

int

A signed integer that indicates the relationship of the current instance to the obj parameter. If the value is less than zero, the current instance is less than the other. If the value is zero, the current instance is equal to the other. If the value is greater than zero, the current instance is greater than the other.

Divide(AngleSingle, AngleSingle)

Divides two Stride.Core.Mathematics.AngleSingle objects and returns the result.

public static AngleSingle Divide(AngleSingle left, AngleSingle right)

Parameters

left AngleSingle

The numerator object.

right AngleSingle

The denominator object.

Returns

AngleSingle

The value of the two objects divided.

Equals(AngleSingle)

Returns a value that indicates whether the current instance and a specified Stride.Core.Mathematics.AngleSingle object have the same value.

public bool Equals(AngleSingle other)

Parameters

other AngleSingle

The object to compare.

Returns

bool

Returns true if this Stride.Core.Mathematics.AngleSingle object and another have the same value; otherwise, false.

Equals(object)

Returns a value that indicates whether the current instance and a specified object have the same value.

public override bool Equals(object obj)

Parameters

obj object

The object to compare.

Returns

bool

Returns true if the obj parameter is a Stride.Core.Mathematics.AngleSingle object or a type capable of implicit conversion to a Stride.Core.Mathematics.AngleSingle value, and its value is equal to the value of the current Stride.Core.Mathematics.Angle object; otherwise, false.

GetHashCode()

Returns a hash code for this Stride.Core.Mathematics.AngleSingle instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer hash code.

Max(AngleSingle, AngleSingle)

Compares two Stride.Core.Mathematics.AngleSingle instances and returns the greater angle.

public static AngleSingle Max(AngleSingle left, AngleSingle right)

Parameters

left AngleSingle

The first Stride.Core.Mathematics.AngleSingle instance to compare.

right AngleSingle

The second Stride.Core.Mathematics.AngleSingle instance to compare.

Returns

AngleSingle

The greater of the two given Stride.Core.Mathematics.AngleSingle instances.

Min(AngleSingle, AngleSingle)

Compares two Stride.Core.Mathematics.AngleSingle instances and returns the smaller angle.

public static AngleSingle Min(AngleSingle left, AngleSingle right)

Parameters

left AngleSingle

The first Stride.Core.Mathematics.AngleSingle instance to compare.

right AngleSingle

The second Stride.Core.Mathematics.AngleSingle instance to compare.

Returns

AngleSingle

The smaller of the two given Stride.Core.Mathematics.AngleSingle instances.

Multiply(AngleSingle, AngleSingle)

Multiplies two Stride.Core.Mathematics.AngleSingle objects and returns the result.

public static AngleSingle Multiply(AngleSingle left, AngleSingle right)

Parameters

left AngleSingle

The first object to multiply.

right AngleSingle

The second object to multiply.

Returns

AngleSingle

The value of the two objects multiplied together.

Subtract(AngleSingle, AngleSingle)

Subtracts two Stride.Core.Mathematics.AngleSingle objects and returns the result.

public static AngleSingle Subtract(AngleSingle left, AngleSingle right)

Parameters

left AngleSingle

The first object to subtract.

right AngleSingle

The second object to subtract.

Returns

AngleSingle

The value of the two objects subtracted.

ToString()

Returns a string that represents this instance.

public override string ToString()

Returns

string

A string that represents this instance.

ToString(IFormatProvider)

Returns a string that represents this instance.

public string ToString(IFormatProvider formatProvider)

Parameters

formatProvider IFormatProvider

The format provider.

Returns

string

A string that represents this instance.

ToString(string)

Returns a string that represents this instance.

public string ToString(string format)

Parameters

format string

The format.

Returns

string

A string that represents this instance.

ToString(string, IFormatProvider)

Returns a string that represents this instance.

public string ToString(string format, IFormatProvider formatProvider)

Parameters

format string

The format.

formatProvider IFormatProvider

The format provider.

Returns

string

A string that represents this instance.

Wrap()

Wraps this Stride.Core.Mathematics.AngleSingle to be in the range [π, -π].

public void Wrap()

Wrap(AngleSingle)

Wraps the Stride.Core.Mathematics.AngleSingle given in the value argument to be in the range [π, -π].

public static AngleSingle Wrap(AngleSingle value)

Parameters

value AngleSingle

A Stride.Core.Mathematics.AngleSingle to wrap.

Returns

AngleSingle

The Stride.Core.Mathematics.AngleSingle that is wrapped.

WrapPositive()

Wraps this Stride.Core.Mathematics.AngleSingle to be in the range [0, 2π).

public void WrapPositive()

WrapPositive(AngleSingle)

Wraps the Stride.Core.Mathematics.AngleSingle given in the value argument to be in the range [0, 2π).

public static AngleSingle WrapPositive(AngleSingle value)

Parameters

value AngleSingle

A Stride.Core.Mathematics.AngleSingle to wrap.

Returns

AngleSingle

The Stride.Core.Mathematics.AngleSingle that is wrapped.

Operators

operator +(AngleSingle, AngleSingle)

Adds two Stride.Core.Mathematics.AngleSingle objects and returns the result.

public static AngleSingle operator +(AngleSingle left, AngleSingle right)

Parameters

left AngleSingle

The first object to add.

right AngleSingle

The second object to add.

Returns

AngleSingle

The value of the two objects added together.

operator /(AngleSingle, AngleSingle)

Divides two Stride.Core.Mathematics.AngleSingle objects and returns the result.

public static AngleSingle operator /(AngleSingle left, AngleSingle right)

Parameters

left AngleSingle

The numerator object.

right AngleSingle

The denominator object.

Returns

AngleSingle

The value of the two objects divided.

operator ==(AngleSingle, AngleSingle)

Returns a System.Boolean that indicates whether the values of two Stride.Core.Mathematics.Angle objects are equal.

public static bool operator ==(AngleSingle left, AngleSingle right)

Parameters

left AngleSingle

The first object to compare.

right AngleSingle

The second object to compare.

Returns

bool

True if the left and right parameters have the same value; otherwise, false.

operator >(AngleSingle, AngleSingle)

Returns a System.Boolean that indicates whether a Stride.Core.Mathematics.Angle object is greater than another Stride.Core.Mathematics.AngleSingle object.

public static bool operator >(AngleSingle left, AngleSingle right)

Parameters

left AngleSingle

The first object to compare.

right AngleSingle

The second object to compare.

Returns

bool

True if left is greater than right; otherwise, false.

operator >=(AngleSingle, AngleSingle)

Returns a System.Boolean that indicates whether a Stride.Core.Mathematics.Angle object is greater than or equal to another Stride.Core.Mathematics.AngleSingle object.

public static bool operator >=(AngleSingle left, AngleSingle right)

Parameters

left AngleSingle

The first object to compare.

right AngleSingle

The second object to compare.

Returns

bool

True if left is greater than or equal to right; otherwise, false.

operator !=(AngleSingle, AngleSingle)

Returns a System.Boolean that indicates whether the values of two Stride.Core.Mathematics.Angle objects are not equal.

public static bool operator !=(AngleSingle left, AngleSingle right)

Parameters

left AngleSingle

The first object to compare.

right AngleSingle

The second object to compare.

Returns

bool

True if the left and right parameters do not have the same value; otherwise, false.

operator <(AngleSingle, AngleSingle)

Returns a System.Boolean that indicates whether a Stride.Core.Mathematics.Angle object is less than another Stride.Core.Mathematics.AngleSingle object.

public static bool operator <(AngleSingle left, AngleSingle right)

Parameters

left AngleSingle

The first object to compare.

right AngleSingle

The second object to compare.

Returns

bool

True if left is less than right; otherwise, false.

operator <=(AngleSingle, AngleSingle)

Returns a System.Boolean that indicates whether a Stride.Core.Mathematics.Angle object is less than or equal to another Stride.Core.Mathematics.AngleSingle object.

public static bool operator <=(AngleSingle left, AngleSingle right)

Parameters

left AngleSingle

The first object to compare.

right AngleSingle

The second object to compare.

Returns

bool

True if left is less than or equal to right; otherwise, false.

operator *(AngleSingle, AngleSingle)

Multiplies two Stride.Core.Mathematics.AngleSingle objects and returns the result.

public static AngleSingle operator *(AngleSingle left, AngleSingle right)

Parameters

left AngleSingle

The first object to multiply.

right AngleSingle

The second object to multiply.

Returns

AngleSingle

The value of the two objects multiplied together.

operator -(AngleSingle, AngleSingle)

Subtracts two Stride.Core.Mathematics.AngleSingle objects and returns the result.

public static AngleSingle operator -(AngleSingle left, AngleSingle right)

Parameters

left AngleSingle

The first object to subtract

right AngleSingle

The second object to subtract.

Returns

AngleSingle

The value of the two objects subtracted.

operator -(AngleSingle)

Returns the the negated value of the Stride.Core.Mathematics.AngleSingle operand.

public static AngleSingle operator -(AngleSingle value)

Parameters

value AngleSingle

A Stride.Core.Mathematics.AngleSingle object.

Returns

AngleSingle

The negated value of the value parameter.

operator +(AngleSingle)

Returns the value of the Stride.Core.Mathematics.AngleSingle operand. (The sign of the operand is unchanged.)

public static AngleSingle operator +(AngleSingle value)

Parameters

value AngleSingle

A Stride.Core.Mathematics.AngleSingle object.

Returns

AngleSingle

The value of the value parameter.