DoubleExtensions Class
Provides extension methods for the type System.Double.
public static class DoubleExtensions
- Inheritance:
- System.Object Object
Methods
ConvertDegreesToRadians(Double)
Converts an angle from degrees to radians.
public static double ConvertDegreesToRadians(this double angle)
Parameter | Type | Description |
---|---|---|
angle | System.Double | The angle value, in degrees (0 - 359.99). |
Returns
- System.Double:
A System.Double of the angle, expressed in radians.
ConvertRadiansToDegrees(Double)
Converts an angle from radians to degrees.
public static double ConvertRadiansToDegrees(this double angle)
Parameter | Type | Description |
---|---|---|
angle | System.Double | The angle value, in radians. |
Returns
- System.Double:
A System.Double of the angle, expressed in degrees.
GetNormalizedDegreeAngle(Double)
Returns a normalized degree angle value in the range of (0 - 359.99).
public static double GetNormalizedDegreeAngle(this double angle)
Parameter | Type | Description |
---|---|---|
angle | System.Double | The angle value, in degrees. |
Returns
- System.Double:
A normalized degree angle value.
IsEffectivelyEqual(Double, Double)
Determines whether the two values are close enough to be considered equal.
public static bool IsEffectivelyEqual(this double left, double right)
Parameter | Type | Description |
---|---|---|
left | System.Double | The value on the left side of the comparison. |
right | System.Double | The value on the left side of the comparison. |
Returns
- System.Boolean:
true
if the two values are close enough to be considered equal; otherwise,false
.
IsEffectivelyGreaterThan(Double, Double)
Determines whether the left value is effectively greater than the right value.
public static bool IsEffectivelyGreaterThan(this double left, double right)
Parameter | Type | Description |
---|---|---|
left | System.Double | The value on the left side of the comparison. |
right | System.Double | The value on the left side of the comparison. |
Returns
- System.Boolean:
true
if the left value is effectively greater than the right value; otherwise,false
.
IsEffectivelyGreaterThanOrEqual(Double, Double)
Determines whether the left value is effectively greater than or equal to the right value.
public static bool IsEffectivelyGreaterThanOrEqual(this double left, double right)
Parameter | Type | Description |
---|---|---|
left | System.Double | The value on the left side of the comparison. |
right | System.Double | The value on the left side of the comparison. |
Returns
- System.Boolean:
true
if the left value is effectively greater than or equal to the right value; otherwise,false
.
IsEffectivelyLessThan(Double, Double)
Determines whether the left value is effectively less than the right value.
public static bool IsEffectivelyLessThan(this double left, double right)
Parameter | Type | Description |
---|---|---|
left | System.Double | The value on the left side of the comparison. |
right | System.Double | The value on the left side of the comparison. |
Returns
- System.Boolean:
true
if the left value is effectively less than the right value; otherwise,false
.
IsEffectivelyLessThanOrEqual(Double, Double)
Determines whether the left value is effectively less than or equal to the right value.
public static bool IsEffectivelyLessThanOrEqual(this double left, double right)
Parameter | Type | Description |
---|---|---|
left | System.Double | The value on the left side of the comparison. |
right | System.Double | The value on the left side of the comparison. |
Returns
- System.Boolean:
true
if the left value is effectively less than or equal to the right value; otherwise,false
.
IsEffectivelyZero(Double)
Determines whether the specified value is close enough to zero to be considered equal.
public static bool IsEffectivelyZero(this double value)
Parameter | Type | Description |
---|---|---|
value | System.Double | The value to compare with zero. |
Returns
- System.Boolean:
true
if the specified value is close enough to zero to be considered equal; otherwise,false
.
IsWithin(Double, Double, Double)
Determines whether the two values are within a specified range.
public static bool IsWithin(this double left, double right, double difference)
Parameter | Type | Description |
---|---|---|
left | System.Double | The value on the left side of the comparison. |
right | System.Double | The value on the left side of the comparison. |
difference | System.Double | The difference threshold. |
Returns
- System.Boolean:
true
if the two values within a specified range; otherwise,false
.
Range(Double, Double, Double)
Returns the specified value constrained to the specified minimum and maximum values.
public static double Range(this double value, double minValue, double maxValue)
Parameter | Type | Description |
---|---|---|
value | System.Double | The value to constrain. |
minValue | System.Double | The minimum value. |
maxValue | System.Double | The maximum value. |
Returns
- System.Double:
The specified value constrained to the specified minimum and maximum values.
Round(Double, RoundMode)
Returns a rounded number using the specified RoundMode.
public static double Round(this double value, RoundMode mode)
Parameter | Type | Description |
---|---|---|
value | System.Double | The value to round. |
mode | RoundMode | The RoundMode to use. |
Returns
- System.Double:
A rounded number using the specified RoundMode.
Inherited Members
- System.Object.ToString()
- System.Object.Equals(System.Object)
- System.Object.Equals(System.Object, System.Object)
- System.Object.ReferenceEquals(System.Object, System.Object)
- System.Object.GetHashCode()
- System.Object.GetType()
- System.Object.MemberwiseClone()