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
floatA unit dependant measure of the angle.
type
AngleTypeThe 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
Fields
Degree
A value that specifies the size of a single degree.
public const float Degree = 0.0027777778
Field Value
Gradian
A value that specifies the size of a single gradian.
public const float Gradian = 0.0025
Field Value
Milliradian
A value that specifies the size of a single milliradian.
public const float Milliradian = 0.00015915494
Field Value
Minute
A value that specifies the size of a single minute.
public const float Minute = 4.6296296E-05
Field Value
Radian
A value that specifies the size of a single radian.
public const float Radian = 0.15915494
Field Value
Second
A value that specifies the size of a single second.
public const float Second = 7.7160496E-07
Field Value
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
Degrees
Gets or sets the total number of degrees this Stride.Core.Mathematics.AngleSingle represents.
public float Degrees { get; set; }
Property Value
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
Gradians
Gets or sets the total number of gradians this Stride.Core.Mathematics.AngleSingle represents.
public float Gradians { get; set; }
Property Value
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
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
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
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
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
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
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
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
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
Radians
Gets or sets the total number of radians this Stride.Core.Mathematics.AngleSingle represents.
public float Radians { get; set; }
Property Value
Revolutions
Gets or sets the total number of revolutions this Stride.Core.Mathematics.AngleSingle represents.
public float Revolutions { get; set; }
Property Value
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
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
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
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
ZeroAngle
Gets a new Stride.Core.Mathematics.AngleSingle instance that represents the zero angle (i.e. 0°).
public static AngleSingle ZeroAngle { get; }
Property Value
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
AngleSingleThe first object to add.
right
AngleSingleThe 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
AngleSingleThe 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
objectThe 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
AngleSingleThe numerator object.
right
AngleSingleThe 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
AngleSingleThe 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
objectThe 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
AngleSingleThe first Stride.Core.Mathematics.AngleSingle instance to compare.
right
AngleSingleThe 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
AngleSingleThe first Stride.Core.Mathematics.AngleSingle instance to compare.
right
AngleSingleThe 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
AngleSingleThe first object to multiply.
right
AngleSingleThe 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
AngleSingleThe first object to subtract.
right
AngleSingleThe 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
ToString(IFormatProvider)
Returns a string that represents this instance.
public string ToString(IFormatProvider formatProvider)
Parameters
formatProvider
IFormatProviderThe format provider.
Returns
ToString(string)
Returns a string that represents this instance.
public string ToString(string format)
Parameters
format
stringThe format.
Returns
ToString(string, IFormatProvider)
Returns a string that represents this instance.
public string ToString(string format, IFormatProvider formatProvider)
Parameters
format
stringThe format.
formatProvider
IFormatProviderThe format provider.
Returns
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
AngleSingleA 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
AngleSingleA 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
AngleSingleThe first object to add.
right
AngleSingleThe 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
AngleSingleThe numerator object.
right
AngleSingleThe 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
AngleSingleThe first object to compare.
right
AngleSingleThe 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
AngleSingleThe first object to compare.
right
AngleSingleThe 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
AngleSingleThe first object to compare.
right
AngleSingleThe 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
AngleSingleThe first object to compare.
right
AngleSingleThe 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
AngleSingleThe first object to compare.
right
AngleSingleThe 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
AngleSingleThe first object to compare.
right
AngleSingleThe 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
AngleSingleThe first object to multiply.
right
AngleSingleThe 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
AngleSingleThe first object to subtract
right
AngleSingleThe 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
AngleSingleA 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
AngleSingleA Stride.Core.Mathematics.AngleSingle object.
Returns
- AngleSingle
The value of the value parameter.