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
angle
NumberValueThe value.
unit
AngleUnitThe 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
angleValue
AngleValueThe 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
number
NumberValueA 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 ornumber
equals NaN.
Acosh(NumberValue)
Returns the angle whose hyperbolic cosine is the specified number.
public static AngleValue Acosh(NumberValue number)
Parameters
number
NumberValueA number representing a hyperbolic cosine, where
number
must 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 ornumber
equals NaN.
Acot(NumberValue)
Returns the angle whose cotangent is the specified number.
public static AngleValue Acot(NumberValue number)
Parameters
number
NumberValueA 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
number
NumberValueA 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
number
NumberValueA 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
number
NumberValueA 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
number
NumberValueA 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
number
NumberValueA 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
number
NumberValueA 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 ornumber
equals NaN.
Asinh(NumberValue)
Returns the angle whose hyperbolic sine is the specified number.
public static AngleValue Asinh(NumberValue number)
Parameters
number
NumberValueA number representing a hyperbolic sine, where
number
must 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
number
equals NaN.
Atan(NumberValue)
Returns the angle whose tangent is the specified number.
public static AngleValue Atan(NumberValue number)
Parameters
number
NumberValueA number representing a tangent.
Returns
- AngleValue
An angle, θ, measured in radians, such that -π/2 ≤ θ ≤ π/2. -or- NaN if
number
equals NaN, -π/2 rounded to double precision (-1.5707963267949) ifnumber
equals NegativeInfinity, or π/2 rounded to double precision (1.5707963267949) ifnumber
equals PositiveInfinity.
Atanh(NumberValue)
Returns the angle whose hyperbolic tangent is the specified number.
public static AngleValue Atanh(NumberValue number)
Parameters
number
NumberValueA number representing a hyperbolic tangent, where
number
must 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 ornumber
equals 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
angleValue
AngleValueThe 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
obj
objectAn 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 obj
in the sort order.Zero This instance occurs in the same position in the sort order as obj
.Greater than zero This instance follows obj
in the sort order.
Exceptions
- ArgumentException
obj
is 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
other
AngleValueAn 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 other
in the sort order.Zero This instance occurs in the same position in the sort order as other
.Greater than zero This instance follows other
in the sort order.
Cos(AngleValue)
The 'cos' function.
public static NumberValue Cos(AngleValue angleValue)
Parameters
angleValue
AngleValueThe 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
angle
AngleValueAn angle.
Returns
- NumberValue
The hyperbolic cosine of
angle
. Ifangle
is equal to NegativeInfinity or PositiveInfinity, PositiveInfinity is returned. Ifangle
is equal to NaN, NaN is returned.
Cot(AngleValue)
The 'cot' function.
public static NumberValue Cot(AngleValue angleValue)
Parameters
angleValue
AngleValueThe 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
angle
AngleValueAn angle, measured in radians.
Returns
- NumberValue
The hyperbolic cotangent of value.
Csc(AngleValue)
The 'csc' function.
public static NumberValue Csc(AngleValue angleValue)
Parameters
angleValue
AngleValueThe 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
angle
AngleValueAn angle.
Returns
- NumberValue
The hyperbolic cosecant of value.
Degree(double)
Creates the AngleValue struct with Degree
unit.
public static AngleValue Degree(double value)
Parameters
value
doubleThe value.
Returns
- AngleValue
The angle.
Degree(NumberValue)
Creates the AngleValue struct with Degree
unit.
public static AngleValue Degree(NumberValue numberValue)
Parameters
numberValue
NumberValueThe value.
Returns
- AngleValue
The angle.
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters
obj
objectThe object to compare with the current instance.
Returns
- bool
true if
obj
and 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
other
AngleValueAn 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
angleValue
AngleValueThe angle.
Returns
- AngleValue
The largest integral value.
Frac(AngleValue)
Returns the fractional part of the angle number.
public static AngleValue Frac(AngleValue angleValue)
Parameters
angleValue
AngleValueThe angle number.
Returns
- AngleValue
The fractional part.
GetHashCode()
Returns the hash code for this instance.
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
value
doubleThe value.
Returns
- AngleValue
The angle.
Gradian(NumberValue)
Creates the AngleValue struct with Gradian
unit.
public static AngleValue Gradian(NumberValue numberValue)
Parameters
numberValue
NumberValueThe 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
value
doubleThe value.
Returns
- AngleValue
The angle.
Radian(NumberValue)
Creates the AngleValue struct with Radian
unit.
public static AngleValue Radian(NumberValue numberValue)
Parameters
numberValue
NumberValueThe 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
angleValue
AngleValueThe angle number.
digits
NumberValueThe number of fractional digits in the return value.
Returns
- AngleValue
The number nearest to
angleValue
that has a number of fractional digits equal todigits
. If value has fewer fractional digits thandigits
,angleValue
is returned unchanged.
Sec(AngleValue)
The 'cot' function.
public static NumberValue Sec(AngleValue angleValue)
Parameters
angleValue
AngleValueThe 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
angle
AngleValueAn angle.
Returns
- NumberValue
The hyperbolic secant of value.
Sin(AngleValue)
The 'sin' function.
public static NumberValue Sin(AngleValue angleValue)
Parameters
angleValue
AngleValueThe 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
angle
AngleValueAn angle.
Returns
- NumberValue
The hyperbolic sine of
angle
. Ifangle
is equal to NegativeInfinity, PositiveInfinity, or NaN.
Tan(AngleValue)
The 'tan' function.
public static NumberValue Tan(AngleValue angleValue)
Parameters
angleValue
AngleValueThe 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
angle
AngleValueAn angle.
Returns
- NumberValue
The hyperbolic tangent of
angle
. Ifangle
is equal to NegativeInfinity, this method returns -1. Ifangle
is equal to PositiveInfinity, this method returns 1. Ifangle
is equal to NaN, this method returns NaN.
To(AngleUnit)
Converts the current object to the specified newUnit
.
public AngleValue To(AngleUnit newUnit)
Parameters
newUnit
AngleUnitThe 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
angleValue
AngleValueAn 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
left
AngleValueThe first object to add.
right
AngleValueThe second object to add.
Returns
- AngleValue
An object that is the sum of
left
andright
.
operator ==(AngleValue, AngleValue)
Determines whether two specified instances of AngleValue are equal.
public static bool operator ==(AngleValue left, AngleValue right)
Parameters
left
AngleValueThe first object to compare.
right
AngleValueThe second object to compare.
Returns
- bool
true
ifleft
is 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
left
AngleValueThe left angle.
right
AngleValueThe right angle.
Returns
- bool
true
if theleft
parameter is greater than theright
parameter; 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
left
AngleValueThe left angle.
right
AngleValueThe right angle.
Returns
- bool
true
if theleft
parameter is greater than or equal to theright
parameter; otherwise,false
.
operator !=(AngleValue, AngleValue)
Determines whether two specified instances of AngleValue are not equal.
public static bool operator !=(AngleValue left, AngleValue right)
Parameters
left
AngleValueThe first object to compare.
right
AngleValueThe second object to compare.
Returns
- bool
true
ifleft
is 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
left
AngleValueThe left angle.
right
AngleValueThe right angle.
Returns
- bool
true
if theleft
parameter is less than theright
parameter; 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
left
AngleValueThe left angle.
right
AngleValueThe right angle.
Returns
- bool
true
if theleft
parameter is less than or equal to theright
parameter; otherwise,false
.
operator -(AngleValue, AngleValue)
Subtracts two objects of AngleValue.
public static AngleValue operator -(AngleValue left, AngleValue right)
Parameters
left
AngleValueThe first object to sub.
right
AngleValueThe second object to sub.
Returns
- AngleValue
An object that is the difference of
left
andright
.
operator -(AngleValue)
Produces the negative of AngleValue.
public static AngleValue operator -(AngleValue angleValue)
Parameters
angleValue
AngleValueThe angle.
Returns
- AngleValue
The negative of
angleValue
.