Repository navigation
Mathf
Home | API by Category | Complete API Index | API Status
| Field | Value |
|---|---|
| Full name | Electron2D.Mathf |
| Namespace | Electron2D |
| Kind | class |
| Category | API Core |
Provides scalar constants and common mathematical operations for engine code and games.
public static class Electron2D.MathfAngles use radians unless a member explicitly names degrees. Single-precision overloads are the primary engine-scalar API; double-precision overloads are provided for calculations that need a wider range or tighter tolerance. All members are stateless and thread-safe; normal nonthrowing calls are allocation-free after JIT warmup. Floating-point members preserve normal IEEE 754 NaN, infinity, and signed-zero behavior unless their individual contract states otherwise.
Kind: constant
public const System.Single E = 2.7182817fThe base of the natural logarithm.
Kind: constant
public const System.Single Epsilon = 1E-06fThe default absolute single-precision comparison tolerance.
Kind: constant
public const System.Single Inf = InfinityfPositive single-precision infinity.
Kind: constant
public const System.Single NaN = NaNfA single-precision value that is not a number.
This value is unequal to every value, including itself.
Kind: constant
public const System.Single Pi = 3.1415927fThe ratio of a circle's circumference to its diameter.
Kind: constant
public const System.Single Sqrt2 = 1.4142135fThe positive square root of two.
Kind: constant
public const System.Single Tau = 6.2831855fThe ratio of a circle's circumference to its radius.
Kind: method
public static System.Double Abs(System.Double value)Returns the absolute value of a double-precision number.
The nonnegative magnitude, or NaN when the input is NaN.
-
value: The input value.
Kind: method
public static System.Int32 Abs(System.Int32 value)Returns the absolute value of an integer.
The nonnegative magnitude.
-
value: The input value.
-
T:System.OverflowException: value is System.Int32.MinValue.
Kind: method
public static System.Single Abs(System.Single value)Returns the absolute value of a single-precision number.
The nonnegative magnitude, or NaN when the input is NaN.
-
value: The input value.
Kind: method
public static System.Double Acos(System.Double value)Returns the double-precision arc cosine in radians.
An angle from zero through pi, or NaN for an out-of-range input.
-
value: A cosine value in the inclusive range negative one through one.
Kind: method
public static System.Single Acos(System.Single value)Returns the arc cosine in radians.
An angle from zero through Electron2D.Mathf.Pi, or NaN for an out-of-range input.
-
value: A cosine value in the inclusive range negative one through one.
Kind: method
public static System.Double Acosh(System.Double value)Returns the double-precision inverse hyperbolic cosine.
The inverse hyperbolic cosine, or NaN for an input below one.
-
value: A value greater than or equal to one.
Kind: method
public static System.Single Acosh(System.Single value)Returns the inverse hyperbolic cosine.
The inverse hyperbolic cosine, or NaN for an input below one.
-
value: A value greater than or equal to one.
Kind: method
public static System.Double AngleDifference(System.Double from, System.Double to)Returns the shortest double-precision signed angular difference.
A difference in the inclusive range negative pi through pi.
-
from: The starting angle in radians. -
to: The destination angle in radians.
Kind: method
public static System.Single AngleDifference(System.Single from, System.Single to)Returns the shortest signed angular difference from one angle to another.
For opposite angles, the result is negative pi when from is smaller than to and positive pi otherwise.
A difference in the inclusive range negative pi through pi.
-
from: The starting angle in radians. -
to: The destination angle in radians.
Kind: method
public static System.Double Asin(System.Double value)Returns the double-precision arc sine in radians.
An angle from negative pi over two through positive pi over two, or NaN for an out-of-range input.
-
value: A sine value in the inclusive range negative one through one.
Kind: method
public static System.Single Asin(System.Single value)Returns the arc sine in radians.
An angle from negative pi over two through positive pi over two, or NaN for an out-of-range input.
-
value: A sine value in the inclusive range negative one through one.
Kind: method
public static System.Double Asinh(System.Double value)Returns the double-precision inverse hyperbolic sine.
The inverse hyperbolic sine.
-
value: The input value.
Kind: method
public static System.Single Asinh(System.Single value)Returns the inverse hyperbolic sine.
The inverse hyperbolic sine.
-
value: The input value.
Kind: method
public static System.Double Atan(System.Double value)Returns the double-precision arc tangent in radians.
An angle from negative pi over two through positive pi over two.
-
value: The tangent value.
Kind: method
public static System.Single Atan(System.Single value)Returns the arc tangent in radians.
An angle from negative pi over two through positive pi over two.
-
value: The tangent value.
Kind: method
public static System.Double Atan2(System.Double y, System.Double x)Returns the double-precision angle of a Cartesian direction in radians.
The quadrant-aware angle from negative pi through positive pi.
-
y: The vertical component. -
x: The horizontal component.
Kind: method
public static System.Single Atan2(System.Single y, System.Single x)Returns the angle of a Cartesian direction in radians.
The quadrant-aware angle from negative pi through positive pi.
-
y: The vertical component. -
x: The horizontal component.
Kind: method
public static System.Double Atanh(System.Double value)Returns the double-precision inverse hyperbolic tangent.
The inverse hyperbolic tangent; the endpoints produce infinities and out-of-range inputs produce NaN.
-
value: A value in the inclusive range negative one through one.
Kind: method
public static System.Single Atanh(System.Single value)Returns the inverse hyperbolic tangent.
The inverse hyperbolic tangent; the endpoints produce infinities and out-of-range inputs produce NaN.
-
value: A value in the inclusive range negative one through one.
Kind: method
public static System.Double BezierDerivative(System.Double start, System.Double control1, System.Double control2, System.Double end, System.Double weight)Evaluates the derivative of a double-precision one-dimensional cubic Bezier curve.
The derivative at the parameter.
-
start: The start value. -
control1: The first control value. -
control2: The second control value. -
end: The end value. -
weight: The curve parameter.
Kind: method
public static System.Single BezierDerivative(System.Single start, System.Single control1, System.Single control2, System.Single end, System.Single weight)Evaluates the derivative of a one-dimensional cubic Bezier curve.
The derivative at the parameter.
-
start: The start value. -
control1: The first control value. -
control2: The second control value. -
end: The end value. -
weight: The curve parameter.
Kind: method
public static System.Double BezierInterpolate(System.Double start, System.Double control1, System.Double control2, System.Double end, System.Double weight)Evaluates a double-precision one-dimensional cubic Bezier curve.
The curve value.
-
start: The start value. -
control1: The first control value. -
control2: The second control value. -
end: The end value. -
weight: The curve parameter; values outside zero through one extrapolate.
Kind: method
public static System.Single BezierInterpolate(System.Single start, System.Single control1, System.Single control2, System.Single end, System.Single weight)Evaluates a one-dimensional cubic Bezier curve.
The curve value.
-
start: The start value. -
control1: The first control value. -
control2: The second control value. -
end: The end value. -
weight: The curve parameter; values outside zero through one extrapolate.
Kind: method
public static System.Double Ceil(System.Double value)Rounds a double-precision value upward toward positive infinity.
The smallest integral floating-point value not less than the input.
-
value: The input value.
Kind: method
public static System.Single Ceil(System.Single value)Rounds upward toward positive infinity.
The smallest integral floating-point value not less than the input.
-
value: The input value.
Kind: method
public static System.Int32 CeilToInt(System.Double value)Rounds a double-precision value upward and converts to a 32-bit integer.
NaN, infinity, and an out-of-range result convert to the runtime-defined unchecked integer sentinel.
The ceiling converted using unchecked managed numeric conversion semantics.
-
value: The input value.
Kind: method
public static System.Int32 CeilToInt(System.Single value)Rounds upward and converts to a 32-bit integer.
NaN, infinity, and an out-of-range result convert to the runtime-defined unchecked integer sentinel.
The ceiling converted using unchecked managed numeric conversion semantics.
-
value: The input value.
Kind: method
public static System.Double Clamp(System.Double value, System.Double min, System.Double max)Restricts a double-precision number to an inclusive interval.
The restricted value.
-
value: The value to restrict. -
min: The inclusive lower bound. -
max: The inclusive upper bound.
-
T:System.ArgumentException: min is greater than max.
Kind: method
public static System.Int32 Clamp(System.Int32 value, System.Int32 min, System.Int32 max)Restricts an integer to an inclusive interval.
The restricted value.
-
value: The value to restrict. -
min: The inclusive lower bound. -
max: The inclusive upper bound.
-
T:System.ArgumentException: min is greater than max.
Kind: method
public static System.Single Clamp(System.Single value, System.Single min, System.Single max)Restricts a single-precision number to an inclusive interval.
The restricted value.
-
value: The value to restrict. -
min: The inclusive lower bound. -
max: The inclusive upper bound.
-
T:System.ArgumentException: min is greater than max.
Kind: method
public static System.Double Cos(System.Double angle)Returns the double-precision cosine of an angle in radians.
The cosine.
-
angle: The angle in radians.
Kind: method
public static System.Single Cos(System.Single angle)Returns the cosine of an angle in radians.
The cosine.
-
angle: The angle in radians.
Kind: method
public static System.Double Cosh(System.Double value)Returns the double-precision hyperbolic cosine.
The hyperbolic cosine.
-
value: The input value.
Kind: method
public static System.Single Cosh(System.Single value)Returns the hyperbolic cosine.
The hyperbolic cosine.
-
value: The input value.
Kind: method
public static System.Double CubicInterpolate(System.Double from, System.Double to, System.Double pre, System.Double post, System.Double weight)Performs double-precision Catmull-Rom cubic interpolation.
The interpolated value.
-
from: The starting value. -
to: The destination value. -
pre: The control value before from. -
post: The control value after to. -
weight: The interpolation weight; values outside zero through one extrapolate.
Kind: method
public static System.Single CubicInterpolate(System.Single from, System.Single to, System.Single pre, System.Single post, System.Single weight)Performs Catmull-Rom cubic interpolation between two values.
The interpolated value.
-
from: The starting value. -
to: The destination value. -
pre: The control value before from. -
post: The control value after to. -
weight: The interpolation weight; values outside zero through one extrapolate.
Kind: method
public static System.Double CubicInterpolateAngle(System.Double from, System.Double to, System.Double pre, System.Double post, System.Double weight)Performs double-precision shortest-path Catmull-Rom interpolation between angles.
The interpolated angle in radians.
-
from: The starting angle. -
to: The destination angle. -
pre: The preceding control angle. -
post: The following control angle. -
weight: The interpolation weight.
Kind: method
public static System.Single CubicInterpolateAngle(System.Single from, System.Single to, System.Single pre, System.Single post, System.Single weight)Performs shortest-path Catmull-Rom interpolation between angles.
The interpolated angle in radians.
-
from: The starting angle. -
to: The destination angle. -
pre: The preceding control angle. -
post: The following control angle. -
weight: The interpolation weight.
CubicInterpolateAngleInTime(System.Double, System.Double, System.Double, System.Double, System.Double, System.Double, System.Double, System.Double)
Kind: method
public static System.Double CubicInterpolateAngleInTime(System.Double from, System.Double to, System.Double pre, System.Double post, System.Double weight, System.Double toTime, System.Double preTime, System.Double postTime)Performs double-precision shortest-path time-aware cubic interpolation between angles.
The time-aware interpolated angle.
-
from: The starting angle at time zero. -
to: The destination angle. -
pre: The preceding control angle. -
post: The following control angle. -
weight: The interpolation weight. -
toTime: The destination time. -
preTime: The preceding control time. -
postTime: The following control time.
CubicInterpolateAngleInTime(System.Single, System.Single, System.Single, System.Single, System.Single, System.Single, System.Single, System.Single)
Kind: method
public static System.Single CubicInterpolateAngleInTime(System.Single from, System.Single to, System.Single pre, System.Single post, System.Single weight, System.Single toTime, System.Single preTime, System.Single postTime)Performs shortest-path time-aware cubic interpolation between angles.
The time-aware interpolated angle.
-
from: The starting angle at time zero. -
to: The destination angle. -
pre: The preceding control angle. -
post: The following control angle. -
weight: The interpolation weight. -
toTime: The destination time. -
preTime: The preceding control time. -
postTime: The following control time.
CubicInterpolateInTime(System.Double, System.Double, System.Double, System.Double, System.Double, System.Double, System.Double, System.Double)
Kind: method
public static System.Double CubicInterpolateInTime(System.Double from, System.Double to, System.Double pre, System.Double post, System.Double weight, System.Double toTime, System.Double preTime, System.Double postTime)Performs double-precision time-aware Barry-Goldman cubic interpolation.
The time-aware interpolated value.
-
from: The starting value at time zero. -
to: The destination value. -
pre: The preceding control value. -
post: The following control value. -
weight: The interpolation weight. -
toTime: The destination time. -
preTime: The preceding control time. -
postTime: The following control time.
CubicInterpolateInTime(System.Single, System.Single, System.Single, System.Single, System.Single, System.Single, System.Single, System.Single)
Kind: method
public static System.Single CubicInterpolateInTime(System.Single from, System.Single to, System.Single pre, System.Single post, System.Single weight, System.Single toTime, System.Single preTime, System.Single postTime)Performs time-aware Barry-Goldman cubic interpolation.
The time-aware interpolated value.
-
from: The starting value at time zero. -
to: The destination value. -
pre: The preceding control value. -
post: The following control value. -
weight: The interpolation weight. -
toTime: The destination time. -
preTime: The preceding control time. -
postTime: The following control time.
Kind: method
public static System.Double DBToLinear(System.Double decibels)Converts double-precision decibels to linear energy.
The corresponding linear energy.
-
decibels: The decibel value.
Kind: method
public static System.Single DBToLinear(System.Single decibels)Converts decibels to linear energy.
The corresponding linear energy.
-
decibels: The decibel value.
Kind: method
public static System.Int32 DecimalCount(System.Decimal value)Returns the number of encoded decimal fractional digits.
The stored decimal scale from zero through twenty-eight.
-
value: The decimal value.
Kind: method
public static System.Int32 DecimalCount(System.Double value)Returns the number of encoded decimal fractional digits.
The scale retained by conversion to System.Decimal.
-
value: A finite value representable by System.Decimal.
-
T:System.OverflowException: value is non-finite or outside the decimal range.
Kind: method
public static System.Double DegToRad(System.Double degrees)Converts double-precision degrees to radians.
The angle in radians.
-
degrees: The angle in degrees.
Kind: method
public static System.Single DegToRad(System.Single degrees)Converts degrees to radians.
The angle in radians.
-
degrees: The angle in degrees.
Kind: method
public static System.Double Ease(System.Double value, System.Double curve)Applies a double-precision exponent-based easing curve to a normalized value.
The eased value.
-
value: The input, clamped to zero through one. -
curve: Zero for constant zero, one for linear, positive values for in or out easing, and negative values for in-out easing.
Kind: method
public static System.Single Ease(System.Single value, System.Single curve)Applies an exponent-based easing curve to a normalized value.
The eased value.
-
value: The input, clamped to zero through one. -
curve: Zero for constant zero, one for linear, positive values for in or out easing, and negative values for in-out easing.
Kind: method
public static System.Double Exp(System.Double value)Raises the natural-logarithm base to a double-precision power.
The natural exponential.
-
value: The exponent.
Kind: method
public static System.Single Exp(System.Single value)Raises the natural-logarithm base to a power.
The natural exponential.
-
value: The exponent.
Kind: method
public static System.Double Floor(System.Double value)Rounds a double-precision value downward toward negative infinity.
The greatest integral floating-point value not greater than the input.
-
value: The input value.
Kind: method
public static System.Single Floor(System.Single value)Rounds downward toward negative infinity.
The greatest integral floating-point value not greater than the input.
-
value: The input value.
Kind: method
public static System.Int32 FloorToInt(System.Double value)Rounds a double-precision value downward and converts to a 32-bit integer.
NaN, infinity, and an out-of-range result convert to the runtime-defined unchecked integer sentinel.
The floor converted using unchecked managed numeric conversion semantics.
-
value: The input value.
Kind: method
public static System.Int32 FloorToInt(System.Single value)Rounds downward and converts to a 32-bit integer.
NaN, infinity, and an out-of-range result convert to the runtime-defined unchecked integer sentinel.
The floor converted using unchecked managed numeric conversion semantics.
-
value: The input value.
Kind: method
public static System.Double InverseLerp(System.Double from, System.Double to, System.Double value)Returns the double-precision unbounded interpolation weight of a value within an interval.
(value - from) / (to - from); equal bounds follow IEEE 754 division behavior.
-
from: The start of the interval. -
to: The end of the interval. -
value: The value to locate.
Kind: method
public static System.Single InverseLerp(System.Single from, System.Single to, System.Single value)Returns the unbounded interpolation weight of a value within an interval.
(value - from) / (to - from); equal bounds follow IEEE 754 division behavior.
-
from: The start of the interval. -
to: The end of the interval. -
value: The value to locate.
Kind: method
public static System.Boolean IsEqualApprox(System.Double left, System.Double right)Tests two double-precision values for scale-aware approximate equality.
true for exact equality or a difference below the double-precision relative tolerance.
-
left: The first value. -
right: The second value.
Kind: method
public static System.Boolean IsEqualApprox(System.Double left, System.Double right, System.Double tolerance)Tests two double-precision values using a caller-supplied absolute tolerance.
A negative or NaN tolerance only permits exact equality.
true for exact equality or a difference strictly below tolerance.
-
left: The first value. -
right: The second value. -
tolerance: The strict upper bound for their absolute difference.
Kind: method
public static System.Boolean IsEqualApprox(System.Single left, System.Single right)Tests two single-precision values for scale-aware approximate equality.
true for exact equality or a difference below the larger of Electron2D.Mathf.Epsilon and Epsilon * abs(left).
-
left: The first value. -
right: The second value.
Kind: method
public static System.Boolean IsEqualApprox(System.Single left, System.Single right, System.Single tolerance)Tests two single-precision values using a caller-supplied absolute tolerance.
A negative or NaN tolerance only permits exact equality.
true for exact equality or a difference strictly below tolerance.
-
left: The first value. -
right: The second value. -
tolerance: The strict upper bound for their absolute difference.
Kind: method
public static System.Boolean IsFinite(System.Double value)Tests whether a double-precision value is neither NaN nor infinity.
true for a finite value.
-
value: The value to test.
Kind: method
public static System.Boolean IsFinite(System.Single value)Tests whether a single-precision value is neither NaN nor infinity.
true for a finite value.
-
value: The value to test.
Kind: method
public static System.Boolean IsInf(System.Double value)Tests whether a double-precision value is positive or negative infinity.
true for either infinity.
-
value: The value to test.
Kind: method
public static System.Boolean IsInf(System.Single value)Tests whether a single-precision value is positive or negative infinity.
true for either infinity.
-
value: The value to test.
Kind: method
public static System.Boolean IsNaN(System.Double value)Tests whether a double-precision value is not a number.
true for NaN.
-
value: The value to test.
Kind: method
public static System.Boolean IsNaN(System.Single value)Tests whether a single-precision value is not a number.
true for NaN.
-
value: The value to test.
Kind: method
public static System.Boolean IsZeroApprox(System.Double value)Tests whether a double-precision value's magnitude is strictly below the double-precision epsilon.
true when the value is approximately zero.
-
value: The value to test.
Kind: method
public static System.Boolean IsZeroApprox(System.Single value)Tests whether a single-precision value's magnitude is strictly below Electron2D.Mathf.Epsilon.
true when the value is approximately zero.
-
value: The value to test.
Kind: method
public static System.Double Lerp(System.Double from, System.Double to, System.Double weight)Linearly interpolates double-precision values without clamping the weight.
The interpolated or extrapolated value.
-
from: The starting value. -
to: The destination value. -
weight: The interpolation weight.
Kind: method
public static System.Single Lerp(System.Single from, System.Single to, System.Single weight)Linearly interpolates without clamping the weight.
The interpolated or extrapolated value.
-
from: The starting value. -
to: The destination value. -
weight: The interpolation weight.
Kind: method
public static System.Double LerpAngle(System.Double from, System.Double to, System.Double weight)Linearly interpolates between double-precision angles along their shortest path.
The interpolated angle.
-
from: The starting angle in radians. -
to: The destination angle in radians. -
weight: The unbounded interpolation weight.
Kind: method
public static System.Single LerpAngle(System.Single from, System.Single to, System.Single weight)Linearly interpolates between angles along their shortest path.
The interpolated angle.
-
from: The starting angle in radians. -
to: The destination angle in radians. -
weight: The unbounded interpolation weight.
Kind: method
public static System.Double LinearToDB(System.Double linear)Converts double-precision linear energy to decibels.
The decibel value; zero produces negative infinity and negative input produces NaN.
-
linear: The linear energy.
Kind: method
public static System.Single LinearToDB(System.Single linear)Converts linear energy to decibels.
The decibel value; zero produces negative infinity and negative input produces NaN.
-
linear: The linear energy.
Kind: method
public static System.Double Log(System.Double value)Returns the double-precision natural logarithm.
The natural logarithm.
-
value: The input; zero produces negative infinity and negative input produces NaN.
Kind: method
public static System.Single Log(System.Single value)Returns the natural logarithm.
The natural logarithm.
-
value: The input; zero produces negative infinity and negative input produces NaN.
Kind: method
public static System.Double Max(System.Double left, System.Double right)Returns the larger double-precision value.
The larger value, or NaN if either value is NaN.
-
left: The first value. -
right: The second value.
Kind: method
public static System.Int32 Max(System.Int32 left, System.Int32 right)Returns the larger integer.
The larger value.
-
left: The first value. -
right: The second value.
Kind: method
public static System.Single Max(System.Single left, System.Single right)Returns the larger single-precision value.
The larger value, or NaN if either value is NaN.
-
left: The first value. -
right: The second value.
Kind: method
public static System.Double Min(System.Double left, System.Double right)Returns the smaller double-precision value.
The smaller value, or NaN if either value is NaN.
-
left: The first value. -
right: The second value.
Kind: method
public static System.Int32 Min(System.Int32 left, System.Int32 right)Returns the smaller integer.
The smaller value.
-
left: The first value. -
right: The second value.
Kind: method
public static System.Single Min(System.Single left, System.Single right)Returns the smaller single-precision value.
The smaller value, or NaN if either value is NaN.
-
left: The first value. -
right: The second value.
Kind: method
public static System.Double MoveToward(System.Double from, System.Double to, System.Double delta)Moves a double-precision value toward a destination by a maximum delta.
The destination when within the step, otherwise the stepped value.
-
from: The starting value. -
to: The destination value. -
delta: The step; a negative step moves away.
-
T:System.ArithmeticException: from or to makes the signed difference NaN.
Kind: method
public static System.Single MoveToward(System.Single from, System.Single to, System.Single delta)Moves a value toward a destination by a maximum delta.
The destination when within the step, otherwise the stepped value.
-
from: The starting value. -
to: The destination value. -
delta: The step; a negative step moves away.
-
T:System.ArithmeticException: from or to makes the signed difference NaN.
Kind: method
public static System.Int32 NearestPo2(System.Int32 value)Returns the smallest representable power of two not less than a positive integer.
Zero for ordinary nonpositive values, the input for a power of two, or the next power of two; overflow wraps exactly as 32-bit arithmetic.
-
value: The input value.
Kind: method
public static System.Double PingPong(System.Double value, System.Double length)Generates a double-precision triangle wave between zero and a length.
The reflected periodic value, or zero when length is zero.
-
value: The wave position. -
length: The endpoint magnitude; negative values behave like their positive magnitude.
Kind: method
public static System.Single PingPong(System.Single value, System.Single length)Generates a triangle wave between zero and a length.
The reflected periodic value, or zero when length is zero.
-
value: The wave position. -
length: The endpoint magnitude; negative values behave like their positive magnitude.
Kind: method
public static System.Double PosMod(System.Double value, System.Double divisor)Returns a canonical double-precision remainder with the divisor's sign.
A remainder in the divisor's direction; a zero divisor produces NaN.
-
value: The dividend. -
divisor: The divisor.
Kind: method
public static System.Int32 PosMod(System.Int32 value, System.Int32 divisor)Returns a canonical integer remainder with the divisor's sign.
A remainder between zero and the divisor in the divisor's direction.
-
value: The dividend. -
divisor: The divisor.
-
T:System.DivideByZeroException: divisor is zero. -
T:System.OverflowException: value is System.Int32.MinValue and divisor is negative one.
Kind: method
public static System.Single PosMod(System.Single value, System.Single divisor)Returns a canonical single-precision remainder with the divisor's sign.
A remainder in the divisor's direction; a zero divisor produces NaN.
-
value: The dividend. -
divisor: The divisor.
Kind: method
public static System.Double Pow(System.Double value, System.Double power)Raises a double-precision value to a power.
The power result under IEEE 754 rules.
-
value: The base. -
power: The exponent.
Kind: method
public static System.Single Pow(System.Single value, System.Single power)Raises a value to a power.
The power result under IEEE 754 rules.
-
value: The base. -
power: The exponent.
Kind: method
public static System.Double RadToDeg(System.Double radians)Converts double-precision radians to degrees.
The angle in degrees.
-
radians: The angle in radians.
Kind: method
public static System.Single RadToDeg(System.Single radians)Converts radians to degrees.
The angle in degrees.
-
radians: The angle in radians.
Kind: method
public static System.Double Remap(System.Double value, System.Double inputFrom, System.Double inputTo, System.Double outputFrom, System.Double outputTo)Maps a double-precision value linearly from one interval to another without clamping.
The mapped value; equal input bounds follow IEEE 754 division behavior.
-
value: The input value. -
inputFrom: The input interval start. -
inputTo: The input interval end. -
outputFrom: The output interval start. -
outputTo: The output interval end.
Kind: method
public static System.Single Remap(System.Single value, System.Single inputFrom, System.Single inputTo, System.Single outputFrom, System.Single outputTo)Maps a value linearly from one interval to another without clamping.
The mapped value; equal input bounds follow IEEE 754 division behavior.
-
value: The input value. -
inputFrom: The input interval start. -
inputTo: The input interval end. -
outputFrom: The output interval start. -
outputTo: The output interval end.
Kind: method
public static System.Double RotateToward(System.Double from, System.Double to, System.Double delta)Rotates a double-precision angle toward another angle without overshooting.
The stepped angle.
-
from: The starting angle in radians. -
to: The destination angle in radians. -
delta: The step; a negative value rotates toward the opposite angle.
Kind: method
public static System.Single RotateToward(System.Single from, System.Single to, System.Single delta)Rotates an angle toward another angle without overshooting.
The stepped angle.
-
from: The starting angle in radians. -
to: The destination angle in radians. -
delta: The step; a negative value rotates toward the opposite angle.
Kind: method
public static System.Double Round(System.Double value)Rounds a double-precision value to the nearest integral value, with midpoint ties to even.
The rounded value.
-
value: The input value.
Kind: method
public static System.Single Round(System.Single value)Rounds to the nearest integral floating-point value, with midpoint ties to even.
The rounded value.
-
value: The input value.
Kind: method
public static System.Int32 RoundToInt(System.Double value)Rounds a double-precision value to the nearest integer, with midpoint ties to even.
NaN, infinity, and an out-of-range result convert to the runtime-defined unchecked integer sentinel.
The rounded value converted using unchecked managed numeric conversion semantics.
-
value: The input value.
Kind: method
public static System.Int32 RoundToInt(System.Single value)Rounds to the nearest integer, with midpoint ties to even.
NaN, infinity, and an out-of-range result convert to the runtime-defined unchecked integer sentinel.
The rounded value converted using unchecked managed numeric conversion semantics.
-
value: The input value.
Kind: method
public static System.Int32 Sign(System.Double value)Returns negative one, zero, or positive one according to a double-precision value's sign.
The sign.
-
value: The input value.
-
T:System.ArithmeticException: value is NaN.
Kind: method
public static System.Int32 Sign(System.Int32 value)Returns negative one, zero, or positive one according to an integer's sign.
The sign.
-
value: The input value.
Kind: method
public static System.Int32 Sign(System.Single value)Returns negative one, zero, or positive one according to a single-precision value's sign.
The sign.
-
value: The input value.
-
T:System.ArithmeticException: value is NaN.
Kind: method
public static System.Double Sin(System.Double angle)Returns the double-precision sine of an angle in radians.
The sine.
-
angle: The angle in radians.
Kind: method
public static System.Single Sin(System.Single angle)Returns the sine of an angle in radians.
The sine.
-
angle: The angle in radians.
Kind: method
public static System.ValueTuple<System.Double, System.Double> SinCos(System.Double angle)Returns the double-precision sine and cosine of an angle in one operation.
A tuple containing sine followed by cosine.
-
angle: The angle in radians.
Kind: method
public static System.ValueTuple<System.Single, System.Single> SinCos(System.Single angle)Returns the sine and cosine of an angle in one operation.
A tuple containing sine followed by cosine.
-
angle: The angle in radians.
Kind: method
public static System.Double Sinh(System.Double value)Returns the double-precision hyperbolic sine.
The hyperbolic sine.
-
value: The input value.
Kind: method
public static System.Single Sinh(System.Single value)Returns the hyperbolic sine.
The hyperbolic sine.
-
value: The input value.
Kind: method
public static System.Double SmoothStep(System.Double from, System.Double to, System.Double value)Returns a double-precision cubic Hermite step between two edges.
A value from zero through one, or from when the edges are approximately equal.
-
from: The first edge. -
to: The second edge. -
value: The value to normalize between the edges.
Kind: method
public static System.Single SmoothStep(System.Single from, System.Single to, System.Single value)Returns a cubic Hermite step between two edges.
A value from zero through one, or from when the edges are approximately equal.
-
from: The first edge. -
to: The second edge. -
value: The value to normalize between the edges.
Kind: method
public static System.Double Snapped(System.Double value, System.Double step)Snaps a double-precision value to the nearest multiple of a step.
floor(value / step + 0.5) * step.
-
value: The value to snap. -
step: The grid step; zero returns value unchanged.
Kind: method
public static System.Single Snapped(System.Single value, System.Single step)Snaps a value to the nearest multiple of a step.
floor(value / step + 0.5) * step.
-
value: The value to snap. -
step: The grid step; zero returns value unchanged.
Kind: method
public static System.Double Sqrt(System.Double value)Returns the double-precision principal square root.
The square root, or NaN for a negative input.
-
value: A nonnegative value.
Kind: method
public static System.Single Sqrt(System.Single value)Returns the principal square root.
The square root, or NaN for a negative input.
-
value: A nonnegative value.
Kind: method
public static System.Int32 StepDecimals(System.Double step)Estimates the position of the first significant fractional decimal digit.
An index from zero through eight; integer and very small fractional inputs return zero.
-
step: The input step.
Kind: method
public static System.Double Tan(System.Double angle)Returns the double-precision tangent of an angle in radians.
The tangent.
-
angle: The angle in radians.
Kind: method
public static System.Single Tan(System.Single angle)Returns the tangent of an angle in radians.
The tangent.
-
angle: The angle in radians.
Kind: method
public static System.Double Tanh(System.Double value)Returns the double-precision hyperbolic tangent.
The hyperbolic tangent.
-
value: The input value.
Kind: method
public static System.Single Tanh(System.Single value)Returns the hyperbolic tangent.
The hyperbolic tangent.
-
value: The input value.
Kind: method
public static System.Double Wrap(System.Double value, System.Double min, System.Double max)Wraps a double-precision value into a half-open interval.
The wrapped value, or min when the interval width is approximately zero.
-
value: The value to wrap. -
min: The inclusive lower bound. -
max: The exclusive upper bound.
Kind: method
public static System.Int32 Wrap(System.Int32 value, System.Int32 min, System.Int32 max)Wraps an integer into a half-open interval.
Arithmetic uses unchecked 32-bit semantics; extreme bounds may overflow the interval width.
The wrapped value, or min when both bounds are equal.
-
value: The value to wrap. -
min: The inclusive lower bound. -
max: The exclusive upper bound.
-
T:System.OverflowException: Unchecked bound arithmetic produces the exceptional System.Int32.MinValue remainder by negative one.
Kind: method
public static System.Single Wrap(System.Single value, System.Single min, System.Single max)Wraps a single-precision value into a half-open interval.
The wrapped value, or min when the interval width is approximately zero.
-
value: The value to wrap. -
min: The inclusive lower bound. -
max: The exclusive upper bound.