Class DoubleExtensions
Mathematical extension methods.
Inheritance
Namespace: X10D.Math
Assembly: X10D.dll
Syntax
public static class DoubleExtensions : object
Methods
| Improve this Doc View SourceAcos(Double)
Returns the arccosine of the specified value.
Declaration
public static double Acos(this double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | The value representing a cosine, which must be greater than or equal to -1, but less than or equal to 1. |
Returns
Type | Description |
---|---|
System.Double | The arccosine of |
Acosh(Double)
Returns the hyperbolic arccosine of the specified value.
Declaration
public static double Acosh(this double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | The value representing a hyperbolic cosine, which must be greater than or equal to 1, but less than or equal to
|
Returns
Type | Description |
---|---|
System.Double | The hyperbolic arccosine of |
Asin(Double)
Returns the arcsine of the specified value.
Declaration
public static double Asin(this double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | The value representing a sine, which must be greater than or equal to -1, but less than or equal to 1. |
Returns
Type | Description |
---|---|
System.Double | The arccosine of |
Asinh(Double)
Returns the hyperbolic arcsine of the specified value.
Declaration
public static double Asinh(this double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | The value representing a hyperbolic sine, which must be greater than or equal to 1, but less than or equal to
|
Returns
Type | Description |
---|---|
System.Double | The hyperbolic arccosine of |
Atan(Double)
Returns the arctangent of the specified value.
Declaration
public static double Atan(this double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | The value representing a tangent, which must be greater than or equal to -1, but less than or equal to 1. |
Returns
Type | Description |
---|---|
System.Double | The arctangent of |
Atanh(Double)
Returns the hyperbolic arctangent of the specified value.
Declaration
public static double Atanh(this double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | The value representing a hyperbolic tangent, which must be greater than or equal to 1, but less than or equal to
|
Returns
Type | Description |
---|---|
System.Double | The hyperbolic arctangent of |
ComplexSqrt(Double)
Returns the complex square root of this double-precision floating-point number.
Declaration
public static Complex ComplexSqrt(this double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | The number whose square root is to be found. |
Returns
Type | Description |
---|---|
Complex | The square root of |
Cos(Double)
Returns the cosine of the specified angle.
Declaration
public static double Cos(this double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | The angle, measured in radians. |
Returns
Type | Description |
---|---|
System.Double | The cosine of |
Cosh(Double)
Returns the hyperbolic cosine of the specified angle.
Declaration
public static double Cosh(this double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | The angle, measured in radians. |
Returns
Type | Description |
---|---|
System.Double | The hyperbolic cosine of |
DegreesToRadians(Double)
Converts the current angle in degrees to its equivalent represented in radians.
Declaration
public static double DegreesToRadians(this double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | The angle in degrees to convert. |
Returns
Type | Description |
---|---|
System.Double | The result of π * |
IsEven(Double)
Returns a value indicating whether the current value is evenly divisible by 2.
Declaration
public static bool IsEven(this double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | The value whose parity to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if |
IsOdd(Double)
Returns a value indicating whether the current value is not evenly divisible by 2.
Declaration
public static bool IsOdd(this double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | The value whose parity to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if |
RadiansToDegrees(Double)
Converts the current angle in radians to its equivalent represented in degrees.
Declaration
public static double RadiansToDegrees(this double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | The angle in radians to convert. |
Returns
Type | Description |
---|---|
System.Double | The result of π * |
Round(Double)
Rounds the current value to the nearest whole number.
Declaration
public static double Round(this double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | The value to round. |
Returns
Type | Description |
---|---|
System.Double |
|
Round(Double, Double)
Rounds the current value to the nearest multiple of a specified number.
Declaration
public static double Round(this double value, double nearest)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | The value to round. |
System.Double | nearest | The nearest multiple to which |
Returns
Type | Description |
---|---|
System.Double |
|
Saturate(Double)
Saturates this double-precision floating-point number.
Declaration
public static double Saturate(this double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | The value to saturate. |
Returns
Type | Description |
---|---|
System.Double | The saturated value. |
Remarks
This method clamps value
between 0 and 1.
Sign(Double)
Returns an integer that indicates the sign of this double-precision floating-point number.
Declaration
public static int Sign(this double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | A signed number. |
Returns
Type | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|
System.Int32 | A number that indicates the sign of
|
Sin(Double)
Returns the sine of the specified angle.
Declaration
public static double Sin(this double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | The angle, in radians. |
Returns
Type | Description |
---|---|
System.Double | The sine of |
Sinh(Double)
Returns the hyperbolic sine of the specified angle.
Declaration
public static double Sinh(this double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | The angle, in radians. |
Returns
Type | Description |
---|---|
System.Double | The hyperbolic sine of |
Sqrt(Double)
Returns the square root of this double-precision floating-point number.
Declaration
public static double Sqrt(this double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | The number whose square root is to be found. |
Returns
Type | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|
System.Double | One of the values in the following table.
|
Tan(Double)
Returns the tangent of the specified angle.
Declaration
public static double Tan(this double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | The angle, measured in radians. |
Returns
Type | Description |
---|---|
System.Double | The tangent of |
Tanh(Double)
Returns the hyperbolic tangent of the specified angle.
Declaration
public static double Tanh(this double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | The angle, measured in radians. |
Returns
Type | Description |
---|---|
System.Double | The hyperbolic tangent of |
Wrap(Double, Double)
Wraps the current double-precision floating-point number between 0 and a high value.
Declaration
public static double Wrap(this double value, double length)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | The value to wrap. |
System.Double | length | The exclusive upper bound. |
Returns
Type | Description |
---|---|
System.Double | The wrapped value. |
Wrap(Double, Double, Double)
Wraps the current double-precision floating-point number between a low and a high value.
Declaration
public static double Wrap(this double value, double low, double high)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | The value to wrap. |
System.Double | low | The inclusive lower bound. |
System.Double | high | The exclusive upper bound. |
Returns
Type | Description |
---|---|
System.Double | The wrapped value. |