Struct AngleValue
- Namespace
- xFunc.Maths.Expressions.Units.AngleUnits
- Assembly
- xFunc.Maths.dll
Represents a number with angle measurement unit.
public readonly struct AngleValue : IEquatable<AngleValue>, IComparable<AngleValue>, IComparable
- Implements
- Inherited Members
Constructors
AngleValue(NumberValue, AngleUnit)
Initializes a new instance of the AngleValue struct.
public AngleValue(NumberValue angle, AngleUnit unit)
Parameters
angleNumberValueThe value.
unitAngleUnitThe unit of number.
Properties
Angle
Gets a value.
public NumberValue Angle { get; }
Property Value
Sign
Gets an integer that indicates the sign of a double-precision floating-point number.
public double Sign { get; }
Property Value
Unit
Gets a unit.
public AngleUnit Unit { get; }
Property Value
Methods
Abs(AngleValue)
Returns the absolute value of a specified angle.
public static AngleValue Abs(AngleValue angleValue)
Parameters
angleValueAngleValueThe angle.
Returns
- AngleValue
The angle,
x, that such that 0 ≤x≤MaxValue.
Acos(NumberValue)
Returns the angle whose cosine is the specified number.
public static AngleValue Acos(NumberValue number)
Parameters
numberNumberValueA number representing a cosine, where d must be greater than or equal to -1, but less than or equal to 1.
Returns
- AngleValue
An angle, θ, measured in radians, such that 0 ≤ θ ≤ π. -or- NaN if
number< -1 ornumber> 1 ornumberequals NaN.
Acosh(NumberValue)
Returns the angle whose hyperbolic cosine is the specified number.
public static AngleValue Acosh(NumberValue number)
Parameters
numberNumberValueA number representing a hyperbolic cosine, where
numbermust be greater than or equal to 1, but less than or equal to PositiveInfinity.
Returns
- AngleValue
An angle, θ, measured in radians, such that 0 ≤ θ ≤ ∞. -or- NaN if
number< 1 ornumberequals NaN.
Acot(NumberValue)
Returns the angle whose cotangent is the specified number.
public static AngleValue Acot(NumberValue number)
Parameters
numberNumberValueA number representing a cotangent.
Returns
- AngleValue
An angle, measured in radians.
Acoth(NumberValue)
Returns the angle whose hyperbolic cotangent is the specified number.
public static AngleValue Acoth(NumberValue number)
Parameters
numberNumberValueA number representing a hyperbolic cotangent.
Returns
- AngleValue
An angle, measured in radians.
Acsc(NumberValue)
Returns the angle whose cosecant is the specified number.
public static AngleValue Acsc(NumberValue number)
Parameters
numberNumberValueA number representing a hyperbolic cosecant.
Returns
- AngleValue
An angle, measured in radians.
Acsch(NumberValue)
Returns the angle whose hyperbolic cosecant is the specified number.
public static AngleValue Acsch(NumberValue number)
Parameters
numberNumberValueA number representing a hyperbolic cosecant.
Returns
- AngleValue
An angle, measured in radians.
AsExpression()
Converts AngleValue to Angle.
public Angle AsExpression()
Returns
- Angle
The angle number.
Asec(NumberValue)
Returns the angle whose secant is the specified number.
public static AngleValue Asec(NumberValue number)
Parameters
numberNumberValueA number representing a secant.
Returns
- AngleValue
An angle, measured in radians.
Asech(NumberValue)
Returns the angle whose hyperbolic secant is the specified number.
public static AngleValue Asech(NumberValue number)
Parameters
numberNumberValueA number representing a hyperbolic secant.
Returns
- AngleValue
An angle, measured in radians.
Asin(NumberValue)
Returns the angle whose sine is the specified number.
public static AngleValue Asin(NumberValue number)
Parameters
numberNumberValueA number representing a sine, where d must be greater than or equal to -1, but less than or equal to 1.
Returns
- AngleValue
An angle, θ, measured in radians, such that -π/2 ≤ θ ≤ π/2. -or- NaN if
number< -1 ornumber> 1 ornumberequals NaN.
Asinh(NumberValue)
Returns the angle whose hyperbolic sine is the specified number.
public static AngleValue Asinh(NumberValue number)
Parameters
numberNumberValueA number representing a hyperbolic sine, where
numbermust be greater than or equal to NegativeInfinity, but less than or equal to PositiveInfinity.
Returns
- AngleValue
An angle, θ, measured in radians, such that -∞ < θ ≤ -1, or 1 ≤ θ < ∞. -or- NaN if
numberequals NaN.
Atan(NumberValue)
Returns the angle whose tangent is the specified number.
public static AngleValue Atan(NumberValue number)
Parameters
numberNumberValueA number representing a tangent.
Returns
- AngleValue
An angle, θ, measured in radians, such that -π/2 ≤ θ ≤ π/2. -or- NaN if
numberequals NaN, -π/2 rounded to double precision (-1.5707963267949) ifnumberequals NegativeInfinity, or π/2 rounded to double precision (1.5707963267949) ifnumberequals PositiveInfinity.
Atanh(NumberValue)
Returns the angle whose hyperbolic tangent is the specified number.
public static AngleValue Atanh(NumberValue number)
Parameters
numberNumberValueA number representing a hyperbolic tangent, where
numbermust be greater than or equal to -1, but less than or equal to 1.
Returns
- AngleValue
An angle, θ, measured in radians, such that -∞ < θ < -1, or 1 < θ < ∞. -or- NaN if
number< -1 ornumber> 1 ornumberequals NaN.
Ceiling(AngleValue)
Returns the smallest integral value that is greater than or equal to the specified angle number.
public static AngleValue Ceiling(AngleValue angleValue)
Parameters
angleValueAngleValueThe angle.
Returns
- AngleValue
The smallest integral value.
CompareTo(object?)
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
public int CompareTo(object? obj)
Parameters
objobjectAn object to compare with this instance.
Returns
- int
A value that indicates the relative order of the objects being compared. The return value has these meanings:
Value Meaning Less than zero This instance precedes objin the sort order.Zero This instance occurs in the same position in the sort order as obj.Greater than zero This instance follows objin the sort order.
Exceptions
- ArgumentException
objis not the same type as this instance.
CompareTo(AngleValue)
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
public int CompareTo(AngleValue other)
Parameters
otherAngleValueAn object to compare with this instance.
Returns
- int
A value that indicates the relative order of the objects being compared. The return value has these meanings:
Value Meaning Less than zero This instance precedes otherin the sort order.Zero This instance occurs in the same position in the sort order as other.Greater than zero This instance follows otherin the sort order.
Cos(AngleValue)
The 'cos' function.
public static NumberValue Cos(AngleValue angleValue)
Parameters
angleValueAngleValueThe angle number.
Returns
- NumberValue
The result of cosine function.
Cosh(AngleValue)
Returns the hyperbolic cosine of the specified angle.
public static NumberValue Cosh(AngleValue angle)
Parameters
angleAngleValueAn angle.
Returns
- NumberValue
The hyperbolic cosine of
angle. Ifangleis equal to NegativeInfinity or PositiveInfinity, PositiveInfinity is returned. Ifangleis equal to NaN, NaN is returned.
Cot(AngleValue)
The 'cot' function.
public static NumberValue Cot(AngleValue angleValue)
Parameters
angleValueAngleValueThe angle number.
Returns
- NumberValue
The result of cotangent function.
Coth(AngleValue)
Returns the hyperbolic cotangent of the specified angle.
public static NumberValue Coth(AngleValue angle)
Parameters
angleAngleValueAn angle, measured in radians.
Returns
- NumberValue
The hyperbolic cotangent of value.
Csc(AngleValue)
The 'csc' function.
public static NumberValue Csc(AngleValue angleValue)
Parameters
angleValueAngleValueThe angle number.
Returns
- NumberValue
The result of cosecant function.
Csch(AngleValue)
Returns the hyperbolic cosecant of the specified angle.
public static NumberValue Csch(AngleValue angle)
Parameters
angleAngleValueAn angle.
Returns
- NumberValue
The hyperbolic cosecant of value.
Degree(double)
Creates the AngleValue struct with Degree unit.
public static AngleValue Degree(double value)
Parameters
valuedoubleThe value.
Returns
- AngleValue
The angle.
Degree(NumberValue)
Creates the AngleValue struct with Degree unit.
public static AngleValue Degree(NumberValue numberValue)
Parameters
numberValueNumberValueThe value.
Returns
- AngleValue
The angle.
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand this instance are the same type and represent the same value; otherwise, false.
Equals(AngleValue)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(AngleValue other)
Parameters
otherAngleValueAn object to compare with this object.
Returns
Floor(AngleValue)
Returns the largest integral value less than or equal to the specified angle number.
public static AngleValue Floor(AngleValue angleValue)
Parameters
angleValueAngleValueThe angle.
Returns
- AngleValue
The largest integral value.
Frac(AngleValue)
Returns the fractional part of the angle number.
public static AngleValue Frac(AngleValue angleValue)
Parameters
angleValueAngleValueThe angle number.
Returns
- AngleValue
The fractional part.
GetHashCode()
Returns the hash code for this instance.
[ExcludeFromCodeCoverage]
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
Gradian(double)
Creates the AngleValue struct with Gradian unit.
public static AngleValue Gradian(double value)
Parameters
valuedoubleThe value.
Returns
- AngleValue
The angle.
Gradian(NumberValue)
Creates the AngleValue struct with Gradian unit.
public static AngleValue Gradian(NumberValue numberValue)
Parameters
numberValueNumberValueThe value.
Returns
- AngleValue
The angle.
Normalize()
Normalizes the current angle between [0, 2pi).
public AngleValue Normalize()
Returns
- AngleValue
The normalized angle.
Radian(double)
Creates the AngleValue struct with Radian unit.
public static AngleValue Radian(double value)
Parameters
valuedoubleThe value.
Returns
- AngleValue
The angle.
Radian(NumberValue)
Creates the AngleValue struct with Radian unit.
public static AngleValue Radian(NumberValue numberValue)
Parameters
numberValueNumberValueThe value.
Returns
- AngleValue
The angle.
Round(AngleValue, NumberValue)
Rounds a double-precision floating-point value to a specified number of fractional digits, and uses the specified rounding convention for midpoint values.
public static AngleValue Round(AngleValue angleValue, NumberValue digits)
Parameters
angleValueAngleValueThe angle number.
digitsNumberValueThe number of fractional digits in the return value.
Returns
- AngleValue
The number nearest to
angleValuethat has a number of fractional digits equal todigits. If value has fewer fractional digits thandigits,angleValueis returned unchanged.
Sec(AngleValue)
The 'cot' function.
public static NumberValue Sec(AngleValue angleValue)
Parameters
angleValueAngleValueThe angle number.
Returns
- NumberValue
The result of secant function.
Sech(AngleValue)
Returns the hyperbolic secant of the specified angle.
public static NumberValue Sech(AngleValue angle)
Parameters
angleAngleValueAn angle.
Returns
- NumberValue
The hyperbolic secant of value.
Sin(AngleValue)
The 'sin' function.
public static NumberValue Sin(AngleValue angleValue)
Parameters
angleValueAngleValueThe angle number.
Returns
- NumberValue
The result of sine function.
Sinh(AngleValue)
Returns the hyperbolic sine of the specified angle.
public static NumberValue Sinh(AngleValue angle)
Parameters
angleAngleValueAn angle.
Returns
- NumberValue
The hyperbolic sine of
angle. Ifangleis equal to NegativeInfinity, PositiveInfinity, or NaN.
Tan(AngleValue)
The 'tan' function.
public static NumberValue Tan(AngleValue angleValue)
Parameters
angleValueAngleValueThe angle number.
Returns
- NumberValue
The result of tangent function.
Tanh(AngleValue)
Returns the hyperbolic tangent of the specified angle.
public static NumberValue Tanh(AngleValue angle)
Parameters
angleAngleValueAn angle.
Returns
- NumberValue
The hyperbolic tangent of
angle. Ifangleis equal to NegativeInfinity, this method returns -1. Ifangleis equal to PositiveInfinity, this method returns 1. Ifangleis equal to NaN, this method returns NaN.
To(AngleUnit)
Converts the current object to the specified newUnit.
public AngleValue To(AngleUnit newUnit)
Parameters
newUnitAngleUnitThe unit to convert to.
Returns
- AngleValue
The angle which is converted to the specified
newUnit.
ToDegree()
Converts the current object to degrees.
public AngleValue ToDegree()
Returns
- AngleValue
The angle which is converted to degrees.
ToGradian()
Converts the current object to gradians.
public AngleValue ToGradian()
Returns
- AngleValue
The angle which is converted to gradians.
ToRadian()
Converts the current object to radians.
public AngleValue ToRadian()
Returns
- AngleValue
The angle which is converted to radians.
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
- string
The fully qualified type name.
Truncate(AngleValue)
Calculates the integral part of a specified angle number.
public static AngleValue Truncate(AngleValue angleValue)
Parameters
angleValueAngleValueAn angle to truncate.
Returns
- AngleValue
The integral part of angle number.
Operators
operator +(AngleValue, AngleValue)
Adds two objects of AngleValue.
public static AngleValue operator +(AngleValue left, AngleValue right)
Parameters
leftAngleValueThe first object to add.
rightAngleValueThe second object to add.
Returns
- AngleValue
An object that is the sum of
leftandright.
operator ==(AngleValue, AngleValue)
Determines whether two specified instances of AngleValue are equal.
public static bool operator ==(AngleValue left, AngleValue right)
Parameters
leftAngleValueThe first object to compare.
rightAngleValueThe second object to compare.
Returns
- bool
trueifleftis equal toright; otherwise,false.
operator >(AngleValue, AngleValue)
Indicates whether left parameter is greater than the right parameter.
public static bool operator >(AngleValue left, AngleValue right)
Parameters
leftAngleValueThe left angle.
rightAngleValueThe right angle.
Returns
- bool
trueif theleftparameter is greater than therightparameter; otherwise,false.
operator >=(AngleValue, AngleValue)
Indicates whether left parameter is greater than or equal to the right parameter.
public static bool operator >=(AngleValue left, AngleValue right)
Parameters
leftAngleValueThe left angle.
rightAngleValueThe right angle.
Returns
- bool
trueif theleftparameter is greater than or equal to therightparameter; otherwise,false.
operator !=(AngleValue, AngleValue)
Determines whether two specified instances of AngleValue are not equal.
public static bool operator !=(AngleValue left, AngleValue right)
Parameters
leftAngleValueThe first object to compare.
rightAngleValueThe second object to compare.
Returns
- bool
trueifleftis not equal toright; otherwise,false.
operator <(AngleValue, AngleValue)
Indicates whether left parameter is less than the right parameter.
public static bool operator <(AngleValue left, AngleValue right)
Parameters
leftAngleValueThe left angle.
rightAngleValueThe right angle.
Returns
- bool
trueif theleftparameter is less than therightparameter; otherwise,false.
operator <=(AngleValue, AngleValue)
Indicates whether left parameter is less than or equal to the right parameter.
public static bool operator <=(AngleValue left, AngleValue right)
Parameters
leftAngleValueThe left angle.
rightAngleValueThe right angle.
Returns
- bool
trueif theleftparameter is less than or equal to therightparameter; otherwise,false.
operator -(AngleValue, AngleValue)
Subtracts two objects of AngleValue.
public static AngleValue operator -(AngleValue left, AngleValue right)
Parameters
leftAngleValueThe first object to sub.
rightAngleValueThe second object to sub.
Returns
- AngleValue
An object that is the difference of
leftandright.
operator -(AngleValue)
Produces the negative of AngleValue.
public static AngleValue operator -(AngleValue angleValue)
Parameters
angleValueAngleValueThe angle.
Returns
- AngleValue
The negative of
angleValue.