Skip to content
eduardgushchin edited this page Oct 2, 2026 · 7 revisions

Home | API by Category | Complete API Index | API Status

Field Value
Full name Electron2D.Mathf
Namespace Electron2D
Kind class
Category API Core

Overview

Provides scalar constants and common mathematical operations for engine code and games.

Syntax

public static class Electron2D.Mathf

Remarks

Angles 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.

Detailed engine reference

Members

Member Kind Summary
public const System.Single E = 2.7182817f constant The base of the natural logarithm.
public const System.Single Epsilon = 1E-06f constant The default absolute single-precision comparison tolerance.
public const System.Single Inf = Infinityf constant Positive single-precision infinity.
public const System.Single NaN = NaNf constant A single-precision value that is not a number.
public const System.Single Pi = 3.1415927f constant The ratio of a circle's circumference to its diameter.
public const System.Single Sqrt2 = 1.4142135f constant The positive square root of two.
public const System.Single Tau = 6.2831855f constant The ratio of a circle's circumference to its radius.
public static System.Double Abs(System.Double value) method Returns the absolute value of a double-precision number.
public static System.Int32 Abs(System.Int32 value) method Returns the absolute value of an integer.
public static System.Single Abs(System.Single value) method Returns the absolute value of a single-precision number.
public static System.Double Acos(System.Double value) method Returns the double-precision arc cosine in radians.
public static System.Single Acos(System.Single value) method Returns the arc cosine in radians.
public static System.Double Acosh(System.Double value) method Returns the double-precision inverse hyperbolic cosine.
public static System.Single Acosh(System.Single value) method Returns the inverse hyperbolic cosine.
public static System.Double AngleDifference(System.Double from, System.Double to) method Returns the shortest double-precision signed angular difference.
public static System.Single AngleDifference(System.Single from, System.Single to) method Returns the shortest signed angular difference from one angle to another.
public static System.Double Asin(System.Double value) method Returns the double-precision arc sine in radians.
public static System.Single Asin(System.Single value) method Returns the arc sine in radians.
public static System.Double Asinh(System.Double value) method Returns the double-precision inverse hyperbolic sine.
public static System.Single Asinh(System.Single value) method Returns the inverse hyperbolic sine.
public static System.Double Atan(System.Double value) method Returns the double-precision arc tangent in radians.
public static System.Single Atan(System.Single value) method Returns the arc tangent in radians.
public static System.Double Atan2(System.Double y, System.Double x) method Returns the double-precision angle of a Cartesian direction in radians.
public static System.Single Atan2(System.Single y, System.Single x) method Returns the angle of a Cartesian direction in radians.
public static System.Double Atanh(System.Double value) method Returns the double-precision inverse hyperbolic tangent.
public static System.Single Atanh(System.Single value) method Returns the inverse hyperbolic tangent.
public static System.Double BezierDerivative(System.Double start, System.Double control1, System.Double control2, System.Double end, System.Double weight) method Evaluates the derivative of a double-precision one-dimensional cubic Bezier curve.
public static System.Single BezierDerivative(System.Single start, System.Single control1, System.Single control2, System.Single end, System.Single weight) method Evaluates the derivative of a one-dimensional cubic Bezier curve.
public static System.Double BezierInterpolate(System.Double start, System.Double control1, System.Double control2, System.Double end, System.Double weight) method Evaluates a double-precision one-dimensional cubic Bezier curve.
public static System.Single BezierInterpolate(System.Single start, System.Single control1, System.Single control2, System.Single end, System.Single weight) method Evaluates a one-dimensional cubic Bezier curve.
public static System.Double Ceil(System.Double value) method Rounds a double-precision value upward toward positive infinity.
public static System.Single Ceil(System.Single value) method Rounds upward toward positive infinity.
public static System.Int32 CeilToInt(System.Double value) method Rounds a double-precision value upward and converts to a 32-bit integer.
public static System.Int32 CeilToInt(System.Single value) method Rounds upward and converts to a 32-bit integer.
public static System.Double Clamp(System.Double value, System.Double min, System.Double max) method Restricts a double-precision number to an inclusive interval.
public static System.Int32 Clamp(System.Int32 value, System.Int32 min, System.Int32 max) method Restricts an integer to an inclusive interval.
public static System.Single Clamp(System.Single value, System.Single min, System.Single max) method Restricts a single-precision number to an inclusive interval.
public static System.Double Cos(System.Double angle) method Returns the double-precision cosine of an angle in radians.
public static System.Single Cos(System.Single angle) method Returns the cosine of an angle in radians.
public static System.Double Cosh(System.Double value) method Returns the double-precision hyperbolic cosine.
public static System.Single Cosh(System.Single value) method Returns the hyperbolic cosine.
public static System.Double CubicInterpolate(System.Double from, System.Double to, System.Double pre, System.Double post, System.Double weight) method Performs double-precision Catmull-Rom cubic interpolation.
public static System.Single CubicInterpolate(System.Single from, System.Single to, System.Single pre, System.Single post, System.Single weight) method Performs Catmull-Rom cubic interpolation between two values.
public static System.Double CubicInterpolateAngle(System.Double from, System.Double to, System.Double pre, System.Double post, System.Double weight) method Performs double-precision shortest-path Catmull-Rom interpolation between angles.
public static System.Single CubicInterpolateAngle(System.Single from, System.Single to, System.Single pre, System.Single post, System.Single weight) method Performs shortest-path Catmull-Rom interpolation between angles.
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) method Performs double-precision shortest-path time-aware cubic interpolation between angles.
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) method Performs shortest-path time-aware cubic interpolation between angles.
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) method Performs double-precision time-aware Barry-Goldman cubic interpolation.
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) method Performs time-aware Barry-Goldman cubic interpolation.
public static System.Double DBToLinear(System.Double decibels) method Converts double-precision decibels to linear energy.
public static System.Single DBToLinear(System.Single decibels) method Converts decibels to linear energy.
public static System.Int32 DecimalCount(System.Decimal value) method Returns the number of encoded decimal fractional digits.
public static System.Int32 DecimalCount(System.Double value) method Returns the number of encoded decimal fractional digits.
public static System.Double DegToRad(System.Double degrees) method Converts double-precision degrees to radians.
public static System.Single DegToRad(System.Single degrees) method Converts degrees to radians.
public static System.Double Ease(System.Double value, System.Double curve) method Applies a double-precision exponent-based easing curve to a normalized value.
public static System.Single Ease(System.Single value, System.Single curve) method Applies an exponent-based easing curve to a normalized value.
public static System.Double Exp(System.Double value) method Raises the natural-logarithm base to a double-precision power.
public static System.Single Exp(System.Single value) method Raises the natural-logarithm base to a power.
public static System.Double Floor(System.Double value) method Rounds a double-precision value downward toward negative infinity.
public static System.Single Floor(System.Single value) method Rounds downward toward negative infinity.
public static System.Int32 FloorToInt(System.Double value) method Rounds a double-precision value downward and converts to a 32-bit integer.
public static System.Int32 FloorToInt(System.Single value) method Rounds downward and converts to a 32-bit integer.
public static System.Double InverseLerp(System.Double from, System.Double to, System.Double value) method Returns the double-precision unbounded interpolation weight of a value within an interval.
public static System.Single InverseLerp(System.Single from, System.Single to, System.Single value) method Returns the unbounded interpolation weight of a value within an interval.
public static System.Boolean IsEqualApprox(System.Double left, System.Double right) method Tests two double-precision values for scale-aware approximate equality.
public static System.Boolean IsEqualApprox(System.Double left, System.Double right, System.Double tolerance) method Tests two double-precision values using a caller-supplied absolute tolerance.
public static System.Boolean IsEqualApprox(System.Single left, System.Single right) method Tests two single-precision values for scale-aware approximate equality.
public static System.Boolean IsEqualApprox(System.Single left, System.Single right, System.Single tolerance) method Tests two single-precision values using a caller-supplied absolute tolerance.
public static System.Boolean IsFinite(System.Double value) method Tests whether a double-precision value is neither NaN nor infinity.
public static System.Boolean IsFinite(System.Single value) method Tests whether a single-precision value is neither NaN nor infinity.
public static System.Boolean IsInf(System.Double value) method Tests whether a double-precision value is positive or negative infinity.
public static System.Boolean IsInf(System.Single value) method Tests whether a single-precision value is positive or negative infinity.
public static System.Boolean IsNaN(System.Double value) method Tests whether a double-precision value is not a number.
public static System.Boolean IsNaN(System.Single value) method Tests whether a single-precision value is not a number.
public static System.Boolean IsZeroApprox(System.Double value) method Tests whether a double-precision value's magnitude is strictly below the double-precision epsilon.
public static System.Boolean IsZeroApprox(System.Single value) method Tests whether a single-precision value's magnitude is strictly below Electron2D.Mathf.Epsilon.
public static System.Double Lerp(System.Double from, System.Double to, System.Double weight) method Linearly interpolates double-precision values without clamping the weight.
public static System.Single Lerp(System.Single from, System.Single to, System.Single weight) method Linearly interpolates without clamping the weight.
public static System.Double LerpAngle(System.Double from, System.Double to, System.Double weight) method Linearly interpolates between double-precision angles along their shortest path.
public static System.Single LerpAngle(System.Single from, System.Single to, System.Single weight) method Linearly interpolates between angles along their shortest path.
public static System.Double LinearToDB(System.Double linear) method Converts double-precision linear energy to decibels.
public static System.Single LinearToDB(System.Single linear) method Converts linear energy to decibels.
public static System.Double Log(System.Double value) method Returns the double-precision natural logarithm.
public static System.Single Log(System.Single value) method Returns the natural logarithm.
public static System.Double Max(System.Double left, System.Double right) method Returns the larger double-precision value.
public static System.Int32 Max(System.Int32 left, System.Int32 right) method Returns the larger integer.
public static System.Single Max(System.Single left, System.Single right) method Returns the larger single-precision value.
public static System.Double Min(System.Double left, System.Double right) method Returns the smaller double-precision value.
public static System.Int32 Min(System.Int32 left, System.Int32 right) method Returns the smaller integer.
public static System.Single Min(System.Single left, System.Single right) method Returns the smaller single-precision value.
public static System.Double MoveToward(System.Double from, System.Double to, System.Double delta) method Moves a double-precision value toward a destination by a maximum delta.
public static System.Single MoveToward(System.Single from, System.Single to, System.Single delta) method Moves a value toward a destination by a maximum delta.
public static System.Int32 NearestPo2(System.Int32 value) method Returns the smallest representable power of two not less than a positive integer.
public static System.Double PingPong(System.Double value, System.Double length) method Generates a double-precision triangle wave between zero and a length.
public static System.Single PingPong(System.Single value, System.Single length) method Generates a triangle wave between zero and a length.
public static System.Double PosMod(System.Double value, System.Double divisor) method Returns a canonical double-precision remainder with the divisor's sign.
public static System.Int32 PosMod(System.Int32 value, System.Int32 divisor) method Returns a canonical integer remainder with the divisor's sign.
public static System.Single PosMod(System.Single value, System.Single divisor) method Returns a canonical single-precision remainder with the divisor's sign.
public static System.Double Pow(System.Double value, System.Double power) method Raises a double-precision value to a power.
public static System.Single Pow(System.Single value, System.Single power) method Raises a value to a power.
public static System.Double RadToDeg(System.Double radians) method Converts double-precision radians to degrees.
public static System.Single RadToDeg(System.Single radians) method Converts radians to degrees.
public static System.Double Remap(System.Double value, System.Double inputFrom, System.Double inputTo, System.Double outputFrom, System.Double outputTo) method Maps a double-precision value linearly from one interval to another without clamping.
public static System.Single Remap(System.Single value, System.Single inputFrom, System.Single inputTo, System.Single outputFrom, System.Single outputTo) method Maps a value linearly from one interval to another without clamping.
public static System.Double RotateToward(System.Double from, System.Double to, System.Double delta) method Rotates a double-precision angle toward another angle without overshooting.
public static System.Single RotateToward(System.Single from, System.Single to, System.Single delta) method Rotates an angle toward another angle without overshooting.
public static System.Double Round(System.Double value) method Rounds a double-precision value to the nearest integral value, with midpoint ties to even.
public static System.Single Round(System.Single value) method Rounds to the nearest integral floating-point value, with midpoint ties to even.
public static System.Int32 RoundToInt(System.Double value) method Rounds a double-precision value to the nearest integer, with midpoint ties to even.
public static System.Int32 RoundToInt(System.Single value) method Rounds to the nearest integer, with midpoint ties to even.
public static System.Int32 Sign(System.Double value) method Returns negative one, zero, or positive one according to a double-precision value's sign.
public static System.Int32 Sign(System.Int32 value) method Returns negative one, zero, or positive one according to an integer's sign.
public static System.Int32 Sign(System.Single value) method Returns negative one, zero, or positive one according to a single-precision value's sign.
public static System.Double Sin(System.Double angle) method Returns the double-precision sine of an angle in radians.
public static System.Single Sin(System.Single angle) method Returns the sine of an angle in radians.
public static System.ValueTuple<System.Double, System.Double> SinCos(System.Double angle) method Returns the double-precision sine and cosine of an angle in one operation.
public static System.ValueTuple<System.Single, System.Single> SinCos(System.Single angle) method Returns the sine and cosine of an angle in one operation.
public static System.Double Sinh(System.Double value) method Returns the double-precision hyperbolic sine.
public static System.Single Sinh(System.Single value) method Returns the hyperbolic sine.
public static System.Double SmoothStep(System.Double from, System.Double to, System.Double value) method Returns a double-precision cubic Hermite step between two edges.
public static System.Single SmoothStep(System.Single from, System.Single to, System.Single value) method Returns a cubic Hermite step between two edges.
public static System.Double Snapped(System.Double value, System.Double step) method Snaps a double-precision value to the nearest multiple of a step.
public static System.Single Snapped(System.Single value, System.Single step) method Snaps a value to the nearest multiple of a step.
public static System.Double Sqrt(System.Double value) method Returns the double-precision principal square root.
public static System.Single Sqrt(System.Single value) method Returns the principal square root.
public static System.Int32 StepDecimals(System.Double step) method Estimates the position of the first significant fractional decimal digit.
public static System.Double Tan(System.Double angle) method Returns the double-precision tangent of an angle in radians.
public static System.Single Tan(System.Single angle) method Returns the tangent of an angle in radians.
public static System.Double Tanh(System.Double value) method Returns the double-precision hyperbolic tangent.
public static System.Single Tanh(System.Single value) method Returns the hyperbolic tangent.
public static System.Double Wrap(System.Double value, System.Double min, System.Double max) method Wraps a double-precision value into a half-open interval.
public static System.Int32 Wrap(System.Int32 value, System.Int32 min, System.Int32 max) method Wraps an integer into a half-open interval.
public static System.Single Wrap(System.Single value, System.Single min, System.Single max) method Wraps a single-precision value into a half-open interval.

Member Details

E

Kind: constant

public const System.Single E = 2.7182817f

Summary

The base of the natural logarithm.

Epsilon

Kind: constant

public const System.Single Epsilon = 1E-06f

Summary

The default absolute single-precision comparison tolerance.

Inf

Kind: constant

public const System.Single Inf = Infinityf

Summary

Positive single-precision infinity.

NaN

Kind: constant

public const System.Single NaN = NaNf

Summary

A single-precision value that is not a number.

Remarks

This value is unequal to every value, including itself.

Pi

Kind: constant

public const System.Single Pi = 3.1415927f

Summary

The ratio of a circle's circumference to its diameter.

Sqrt2

Kind: constant

public const System.Single Sqrt2 = 1.4142135f

Summary

The positive square root of two.

Tau

Kind: constant

public const System.Single Tau = 6.2831855f

Summary

The ratio of a circle's circumference to its radius.

Abs(System.Double)

Kind: method

public static System.Double Abs(System.Double value)

Summary

Returns the absolute value of a double-precision number.

Returns

The nonnegative magnitude, or NaN when the input is NaN.

Parameters

  • value: The input value.

Abs(System.Int32)

Kind: method

public static System.Int32 Abs(System.Int32 value)

Summary

Returns the absolute value of an integer.

Returns

The nonnegative magnitude.

Parameters

  • value: The input value.

Exceptions

  • T:System.OverflowException: value is System.Int32.MinValue.

Abs(System.Single)

Kind: method

public static System.Single Abs(System.Single value)

Summary

Returns the absolute value of a single-precision number.

Returns

The nonnegative magnitude, or NaN when the input is NaN.

Parameters

  • value: The input value.

Acos(System.Double)

Kind: method

public static System.Double Acos(System.Double value)

Summary

Returns the double-precision arc cosine in radians.

Returns

An angle from zero through pi, or NaN for an out-of-range input.

Parameters

  • value: A cosine value in the inclusive range negative one through one.

Acos(System.Single)

Kind: method

public static System.Single Acos(System.Single value)

Summary

Returns the arc cosine in radians.

Returns

An angle from zero through Electron2D.Mathf.Pi, or NaN for an out-of-range input.

Parameters

  • value: A cosine value in the inclusive range negative one through one.

Acosh(System.Double)

Kind: method

public static System.Double Acosh(System.Double value)

Summary

Returns the double-precision inverse hyperbolic cosine.

Returns

The inverse hyperbolic cosine, or NaN for an input below one.

Parameters

  • value: A value greater than or equal to one.

Acosh(System.Single)

Kind: method

public static System.Single Acosh(System.Single value)

Summary

Returns the inverse hyperbolic cosine.

Returns

The inverse hyperbolic cosine, or NaN for an input below one.

Parameters

  • value: A value greater than or equal to one.

AngleDifference(System.Double, System.Double)

Kind: method

public static System.Double AngleDifference(System.Double from, System.Double to)

Summary

Returns the shortest double-precision signed angular difference.

Returns

A difference in the inclusive range negative pi through pi.

Parameters

  • from: The starting angle in radians.
  • to: The destination angle in radians.

AngleDifference(System.Single, System.Single)

Kind: method

public static System.Single AngleDifference(System.Single from, System.Single to)

Summary

Returns the shortest signed angular difference from one angle to another.

Remarks

For opposite angles, the result is negative pi when from is smaller than to and positive pi otherwise.

Returns

A difference in the inclusive range negative pi through pi.

Parameters

  • from: The starting angle in radians.
  • to: The destination angle in radians.

Asin(System.Double)

Kind: method

public static System.Double Asin(System.Double value)

Summary

Returns the double-precision arc sine in radians.

Returns

An angle from negative pi over two through positive pi over two, or NaN for an out-of-range input.

Parameters

  • value: A sine value in the inclusive range negative one through one.

Asin(System.Single)

Kind: method

public static System.Single Asin(System.Single value)

Summary

Returns the arc sine in radians.

Returns

An angle from negative pi over two through positive pi over two, or NaN for an out-of-range input.

Parameters

  • value: A sine value in the inclusive range negative one through one.

Asinh(System.Double)

Kind: method

public static System.Double Asinh(System.Double value)

Summary

Returns the double-precision inverse hyperbolic sine.

Returns

The inverse hyperbolic sine.

Parameters

  • value: The input value.

Asinh(System.Single)

Kind: method

public static System.Single Asinh(System.Single value)

Summary

Returns the inverse hyperbolic sine.

Returns

The inverse hyperbolic sine.

Parameters

  • value: The input value.

Atan(System.Double)

Kind: method

public static System.Double Atan(System.Double value)

Summary

Returns the double-precision arc tangent in radians.

Returns

An angle from negative pi over two through positive pi over two.

Parameters

  • value: The tangent value.

Atan(System.Single)

Kind: method

public static System.Single Atan(System.Single value)

Summary

Returns the arc tangent in radians.

Returns

An angle from negative pi over two through positive pi over two.

Parameters

  • value: The tangent value.

Atan2(System.Double, System.Double)

Kind: method

public static System.Double Atan2(System.Double y, System.Double x)

Summary

Returns the double-precision angle of a Cartesian direction in radians.

Returns

The quadrant-aware angle from negative pi through positive pi.

Parameters

  • y: The vertical component.
  • x: The horizontal component.

Atan2(System.Single, System.Single)

Kind: method

public static System.Single Atan2(System.Single y, System.Single x)

Summary

Returns the angle of a Cartesian direction in radians.

Returns

The quadrant-aware angle from negative pi through positive pi.

Parameters

  • y: The vertical component.
  • x: The horizontal component.

Atanh(System.Double)

Kind: method

public static System.Double Atanh(System.Double value)

Summary

Returns the double-precision inverse hyperbolic tangent.

Returns

The inverse hyperbolic tangent; the endpoints produce infinities and out-of-range inputs produce NaN.

Parameters

  • value: A value in the inclusive range negative one through one.

Atanh(System.Single)

Kind: method

public static System.Single Atanh(System.Single value)

Summary

Returns the inverse hyperbolic tangent.

Returns

The inverse hyperbolic tangent; the endpoints produce infinities and out-of-range inputs produce NaN.

Parameters

  • value: A value in the inclusive range negative one through one.

BezierDerivative(System.Double, System.Double, System.Double, System.Double, System.Double)

Kind: method

public static System.Double BezierDerivative(System.Double start, System.Double control1, System.Double control2, System.Double end, System.Double weight)

Summary

Evaluates the derivative of a double-precision one-dimensional cubic Bezier curve.

Returns

The derivative at the parameter.

Parameters

  • start: The start value.
  • control1: The first control value.
  • control2: The second control value.
  • end: The end value.
  • weight: The curve parameter.

BezierDerivative(System.Single, System.Single, System.Single, System.Single, System.Single)

Kind: method

public static System.Single BezierDerivative(System.Single start, System.Single control1, System.Single control2, System.Single end, System.Single weight)

Summary

Evaluates the derivative of a one-dimensional cubic Bezier curve.

Returns

The derivative at the parameter.

Parameters

  • start: The start value.
  • control1: The first control value.
  • control2: The second control value.
  • end: The end value.
  • weight: The curve parameter.

BezierInterpolate(System.Double, System.Double, System.Double, System.Double, System.Double)

Kind: method

public static System.Double BezierInterpolate(System.Double start, System.Double control1, System.Double control2, System.Double end, System.Double weight)

Summary

Evaluates a double-precision one-dimensional cubic Bezier curve.

Returns

The curve value.

Parameters

  • 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.

BezierInterpolate(System.Single, System.Single, System.Single, System.Single, System.Single)

Kind: method

public static System.Single BezierInterpolate(System.Single start, System.Single control1, System.Single control2, System.Single end, System.Single weight)

Summary

Evaluates a one-dimensional cubic Bezier curve.

Returns

The curve value.

Parameters

  • 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.

Ceil(System.Double)

Kind: method

public static System.Double Ceil(System.Double value)

Summary

Rounds a double-precision value upward toward positive infinity.

Returns

The smallest integral floating-point value not less than the input.

Parameters

  • value: The input value.

Ceil(System.Single)

Kind: method

public static System.Single Ceil(System.Single value)

Summary

Rounds upward toward positive infinity.

Returns

The smallest integral floating-point value not less than the input.

Parameters

  • value: The input value.

CeilToInt(System.Double)

Kind: method

public static System.Int32 CeilToInt(System.Double value)

Summary

Rounds a double-precision value upward and converts to a 32-bit integer.

Remarks

NaN, infinity, and an out-of-range result convert to the runtime-defined unchecked integer sentinel.

Returns

The ceiling converted using unchecked managed numeric conversion semantics.

Parameters

  • value: The input value.

CeilToInt(System.Single)

Kind: method

public static System.Int32 CeilToInt(System.Single value)

Summary

Rounds upward and converts to a 32-bit integer.

Remarks

NaN, infinity, and an out-of-range result convert to the runtime-defined unchecked integer sentinel.

Returns

The ceiling converted using unchecked managed numeric conversion semantics.

Parameters

  • value: The input value.

Clamp(System.Double, System.Double, System.Double)

Kind: method

public static System.Double Clamp(System.Double value, System.Double min, System.Double max)

Summary

Restricts a double-precision number to an inclusive interval.

Returns

The restricted value.

Parameters

  • value: The value to restrict.
  • min: The inclusive lower bound.
  • max: The inclusive upper bound.

Exceptions

  • T:System.ArgumentException: min is greater than max.

Clamp(System.Int32, System.Int32, System.Int32)

Kind: method

public static System.Int32 Clamp(System.Int32 value, System.Int32 min, System.Int32 max)

Summary

Restricts an integer to an inclusive interval.

Returns

The restricted value.

Parameters

  • value: The value to restrict.
  • min: The inclusive lower bound.
  • max: The inclusive upper bound.

Exceptions

  • T:System.ArgumentException: min is greater than max.

Clamp(System.Single, System.Single, System.Single)

Kind: method

public static System.Single Clamp(System.Single value, System.Single min, System.Single max)

Summary

Restricts a single-precision number to an inclusive interval.

Returns

The restricted value.

Parameters

  • value: The value to restrict.
  • min: The inclusive lower bound.
  • max: The inclusive upper bound.

Exceptions

  • T:System.ArgumentException: min is greater than max.

Cos(System.Double)

Kind: method

public static System.Double Cos(System.Double angle)

Summary

Returns the double-precision cosine of an angle in radians.

Returns

The cosine.

Parameters

  • angle: The angle in radians.

Cos(System.Single)

Kind: method

public static System.Single Cos(System.Single angle)

Summary

Returns the cosine of an angle in radians.

Returns

The cosine.

Parameters

  • angle: The angle in radians.

Cosh(System.Double)

Kind: method

public static System.Double Cosh(System.Double value)

Summary

Returns the double-precision hyperbolic cosine.

Returns

The hyperbolic cosine.

Parameters

  • value: The input value.

Cosh(System.Single)

Kind: method

public static System.Single Cosh(System.Single value)

Summary

Returns the hyperbolic cosine.

Returns

The hyperbolic cosine.

Parameters

  • value: The input value.

CubicInterpolate(System.Double, System.Double, System.Double, System.Double, System.Double)

Kind: method

public static System.Double CubicInterpolate(System.Double from, System.Double to, System.Double pre, System.Double post, System.Double weight)

Summary

Performs double-precision Catmull-Rom cubic interpolation.

Returns

The interpolated value.

Parameters

  • 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.

CubicInterpolate(System.Single, System.Single, System.Single, System.Single, System.Single)

Kind: method

public static System.Single CubicInterpolate(System.Single from, System.Single to, System.Single pre, System.Single post, System.Single weight)

Summary

Performs Catmull-Rom cubic interpolation between two values.

Returns

The interpolated value.

Parameters

  • 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.

CubicInterpolateAngle(System.Double, System.Double, System.Double, System.Double, System.Double)

Kind: method

public static System.Double CubicInterpolateAngle(System.Double from, System.Double to, System.Double pre, System.Double post, System.Double weight)

Summary

Performs double-precision shortest-path Catmull-Rom interpolation between angles.

Returns

The interpolated angle in radians.

Parameters

  • from: The starting angle.
  • to: The destination angle.
  • pre: The preceding control angle.
  • post: The following control angle.
  • weight: The interpolation weight.

CubicInterpolateAngle(System.Single, System.Single, System.Single, System.Single, System.Single)

Kind: method

public static System.Single CubicInterpolateAngle(System.Single from, System.Single to, System.Single pre, System.Single post, System.Single weight)

Summary

Performs shortest-path Catmull-Rom interpolation between angles.

Returns

The interpolated angle in radians.

Parameters

  • 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)

Summary

Performs double-precision shortest-path time-aware cubic interpolation between angles.

Returns

The time-aware interpolated angle.

Parameters

  • 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)

Summary

Performs shortest-path time-aware cubic interpolation between angles.

Returns

The time-aware interpolated angle.

Parameters

  • 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)

Summary

Performs double-precision time-aware Barry-Goldman cubic interpolation.

Returns

The time-aware interpolated value.

Parameters

  • 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)

Summary

Performs time-aware Barry-Goldman cubic interpolation.

Returns

The time-aware interpolated value.

Parameters

  • 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.

DBToLinear(System.Double)

Kind: method

public static System.Double DBToLinear(System.Double decibels)

Summary

Converts double-precision decibels to linear energy.

Returns

The corresponding linear energy.

Parameters

  • decibels: The decibel value.

DBToLinear(System.Single)

Kind: method

public static System.Single DBToLinear(System.Single decibels)

Summary

Converts decibels to linear energy.

Returns

The corresponding linear energy.

Parameters

  • decibels: The decibel value.

DecimalCount(System.Decimal)

Kind: method

public static System.Int32 DecimalCount(System.Decimal value)

Summary

Returns the number of encoded decimal fractional digits.

Returns

The stored decimal scale from zero through twenty-eight.

Parameters

  • value: The decimal value.

DecimalCount(System.Double)

Kind: method

public static System.Int32 DecimalCount(System.Double value)

Summary

Returns the number of encoded decimal fractional digits.

Returns

The scale retained by conversion to System.Decimal.

Parameters

  • value: A finite value representable by System.Decimal.

Exceptions

  • T:System.OverflowException: value is non-finite or outside the decimal range.

DegToRad(System.Double)

Kind: method

public static System.Double DegToRad(System.Double degrees)

Summary

Converts double-precision degrees to radians.

Returns

The angle in radians.

Parameters

  • degrees: The angle in degrees.

DegToRad(System.Single)

Kind: method

public static System.Single DegToRad(System.Single degrees)

Summary

Converts degrees to radians.

Returns

The angle in radians.

Parameters

  • degrees: The angle in degrees.

Ease(System.Double, System.Double)

Kind: method

public static System.Double Ease(System.Double value, System.Double curve)

Summary

Applies a double-precision exponent-based easing curve to a normalized value.

Returns

The eased value.

Parameters

  • 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.

Ease(System.Single, System.Single)

Kind: method

public static System.Single Ease(System.Single value, System.Single curve)

Summary

Applies an exponent-based easing curve to a normalized value.

Returns

The eased value.

Parameters

  • 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.

Exp(System.Double)

Kind: method

public static System.Double Exp(System.Double value)

Summary

Raises the natural-logarithm base to a double-precision power.

Returns

The natural exponential.

Parameters

  • value: The exponent.

Exp(System.Single)

Kind: method

public static System.Single Exp(System.Single value)

Summary

Raises the natural-logarithm base to a power.

Returns

The natural exponential.

Parameters

  • value: The exponent.

Floor(System.Double)

Kind: method

public static System.Double Floor(System.Double value)

Summary

Rounds a double-precision value downward toward negative infinity.

Returns

The greatest integral floating-point value not greater than the input.

Parameters

  • value: The input value.

Floor(System.Single)

Kind: method

public static System.Single Floor(System.Single value)

Summary

Rounds downward toward negative infinity.

Returns

The greatest integral floating-point value not greater than the input.

Parameters

  • value: The input value.

FloorToInt(System.Double)

Kind: method

public static System.Int32 FloorToInt(System.Double value)

Summary

Rounds a double-precision value downward and converts to a 32-bit integer.

Remarks

NaN, infinity, and an out-of-range result convert to the runtime-defined unchecked integer sentinel.

Returns

The floor converted using unchecked managed numeric conversion semantics.

Parameters

  • value: The input value.

FloorToInt(System.Single)

Kind: method

public static System.Int32 FloorToInt(System.Single value)

Summary

Rounds downward and converts to a 32-bit integer.

Remarks

NaN, infinity, and an out-of-range result convert to the runtime-defined unchecked integer sentinel.

Returns

The floor converted using unchecked managed numeric conversion semantics.

Parameters

  • value: The input value.

InverseLerp(System.Double, System.Double, System.Double)

Kind: method

public static System.Double InverseLerp(System.Double from, System.Double to, System.Double value)

Summary

Returns the double-precision unbounded interpolation weight of a value within an interval.

Returns

(value - from) / (to - from); equal bounds follow IEEE 754 division behavior.

Parameters

  • from: The start of the interval.
  • to: The end of the interval.
  • value: The value to locate.

InverseLerp(System.Single, System.Single, System.Single)

Kind: method

public static System.Single InverseLerp(System.Single from, System.Single to, System.Single value)

Summary

Returns the unbounded interpolation weight of a value within an interval.

Returns

(value - from) / (to - from); equal bounds follow IEEE 754 division behavior.

Parameters

  • from: The start of the interval.
  • to: The end of the interval.
  • value: The value to locate.

IsEqualApprox(System.Double, System.Double)

Kind: method

public static System.Boolean IsEqualApprox(System.Double left, System.Double right)

Summary

Tests two double-precision values for scale-aware approximate equality.

Returns

true for exact equality or a difference below the double-precision relative tolerance.

Parameters

  • left: The first value.
  • right: The second value.

IsEqualApprox(System.Double, System.Double, System.Double)

Kind: method

public static System.Boolean IsEqualApprox(System.Double left, System.Double right, System.Double tolerance)

Summary

Tests two double-precision values using a caller-supplied absolute tolerance.

Remarks

A negative or NaN tolerance only permits exact equality.

Returns

true for exact equality or a difference strictly below tolerance.

Parameters

  • left: The first value.
  • right: The second value.
  • tolerance: The strict upper bound for their absolute difference.

IsEqualApprox(System.Single, System.Single)

Kind: method

public static System.Boolean IsEqualApprox(System.Single left, System.Single right)

Summary

Tests two single-precision values for scale-aware approximate equality.

Returns

true for exact equality or a difference below the larger of Electron2D.Mathf.Epsilon and Epsilon * abs(left).

Parameters

  • left: The first value.
  • right: The second value.

IsEqualApprox(System.Single, System.Single, System.Single)

Kind: method

public static System.Boolean IsEqualApprox(System.Single left, System.Single right, System.Single tolerance)

Summary

Tests two single-precision values using a caller-supplied absolute tolerance.

Remarks

A negative or NaN tolerance only permits exact equality.

Returns

true for exact equality or a difference strictly below tolerance.

Parameters

  • left: The first value.
  • right: The second value.
  • tolerance: The strict upper bound for their absolute difference.

IsFinite(System.Double)

Kind: method

public static System.Boolean IsFinite(System.Double value)

Summary

Tests whether a double-precision value is neither NaN nor infinity.

Returns

true for a finite value.

Parameters

  • value: The value to test.

IsFinite(System.Single)

Kind: method

public static System.Boolean IsFinite(System.Single value)

Summary

Tests whether a single-precision value is neither NaN nor infinity.

Returns

true for a finite value.

Parameters

  • value: The value to test.

IsInf(System.Double)

Kind: method

public static System.Boolean IsInf(System.Double value)

Summary

Tests whether a double-precision value is positive or negative infinity.

Returns

true for either infinity.

Parameters

  • value: The value to test.

IsInf(System.Single)

Kind: method

public static System.Boolean IsInf(System.Single value)

Summary

Tests whether a single-precision value is positive or negative infinity.

Returns

true for either infinity.

Parameters

  • value: The value to test.

IsNaN(System.Double)

Kind: method

public static System.Boolean IsNaN(System.Double value)

Summary

Tests whether a double-precision value is not a number.

Returns

true for NaN.

Parameters

  • value: The value to test.

IsNaN(System.Single)

Kind: method

public static System.Boolean IsNaN(System.Single value)

Summary

Tests whether a single-precision value is not a number.

Returns

true for NaN.

Parameters

  • value: The value to test.

IsZeroApprox(System.Double)

Kind: method

public static System.Boolean IsZeroApprox(System.Double value)

Summary

Tests whether a double-precision value's magnitude is strictly below the double-precision epsilon.

Returns

true when the value is approximately zero.

Parameters

  • value: The value to test.

IsZeroApprox(System.Single)

Kind: method

public static System.Boolean IsZeroApprox(System.Single value)

Summary

Tests whether a single-precision value's magnitude is strictly below Electron2D.Mathf.Epsilon.

Returns

true when the value is approximately zero.

Parameters

  • value: The value to test.

Lerp(System.Double, System.Double, System.Double)

Kind: method

public static System.Double Lerp(System.Double from, System.Double to, System.Double weight)

Summary

Linearly interpolates double-precision values without clamping the weight.

Returns

The interpolated or extrapolated value.

Parameters

  • from: The starting value.
  • to: The destination value.
  • weight: The interpolation weight.

Lerp(System.Single, System.Single, System.Single)

Kind: method

public static System.Single Lerp(System.Single from, System.Single to, System.Single weight)

Summary

Linearly interpolates without clamping the weight.

Returns

The interpolated or extrapolated value.

Parameters

  • from: The starting value.
  • to: The destination value.
  • weight: The interpolation weight.

LerpAngle(System.Double, System.Double, System.Double)

Kind: method

public static System.Double LerpAngle(System.Double from, System.Double to, System.Double weight)

Summary

Linearly interpolates between double-precision angles along their shortest path.

Returns

The interpolated angle.

Parameters

  • from: The starting angle in radians.
  • to: The destination angle in radians.
  • weight: The unbounded interpolation weight.

LerpAngle(System.Single, System.Single, System.Single)

Kind: method

public static System.Single LerpAngle(System.Single from, System.Single to, System.Single weight)

Summary

Linearly interpolates between angles along their shortest path.

Returns

The interpolated angle.

Parameters

  • from: The starting angle in radians.
  • to: The destination angle in radians.
  • weight: The unbounded interpolation weight.

LinearToDB(System.Double)

Kind: method

public static System.Double LinearToDB(System.Double linear)

Summary

Converts double-precision linear energy to decibels.

Returns

The decibel value; zero produces negative infinity and negative input produces NaN.

Parameters

  • linear: The linear energy.

LinearToDB(System.Single)

Kind: method

public static System.Single LinearToDB(System.Single linear)

Summary

Converts linear energy to decibels.

Returns

The decibel value; zero produces negative infinity and negative input produces NaN.

Parameters

  • linear: The linear energy.

Log(System.Double)

Kind: method

public static System.Double Log(System.Double value)

Summary

Returns the double-precision natural logarithm.

Returns

The natural logarithm.

Parameters

  • value: The input; zero produces negative infinity and negative input produces NaN.

Log(System.Single)

Kind: method

public static System.Single Log(System.Single value)

Summary

Returns the natural logarithm.

Returns

The natural logarithm.

Parameters

  • value: The input; zero produces negative infinity and negative input produces NaN.

Max(System.Double, System.Double)

Kind: method

public static System.Double Max(System.Double left, System.Double right)

Summary

Returns the larger double-precision value.

Returns

The larger value, or NaN if either value is NaN.

Parameters

  • left: The first value.
  • right: The second value.

Max(System.Int32, System.Int32)

Kind: method

public static System.Int32 Max(System.Int32 left, System.Int32 right)

Summary

Returns the larger integer.

Returns

The larger value.

Parameters

  • left: The first value.
  • right: The second value.

Max(System.Single, System.Single)

Kind: method

public static System.Single Max(System.Single left, System.Single right)

Summary

Returns the larger single-precision value.

Returns

The larger value, or NaN if either value is NaN.

Parameters

  • left: The first value.
  • right: The second value.

Min(System.Double, System.Double)

Kind: method

public static System.Double Min(System.Double left, System.Double right)

Summary

Returns the smaller double-precision value.

Returns

The smaller value, or NaN if either value is NaN.

Parameters

  • left: The first value.
  • right: The second value.

Min(System.Int32, System.Int32)

Kind: method

public static System.Int32 Min(System.Int32 left, System.Int32 right)

Summary

Returns the smaller integer.

Returns

The smaller value.

Parameters

  • left: The first value.
  • right: The second value.

Min(System.Single, System.Single)

Kind: method

public static System.Single Min(System.Single left, System.Single right)

Summary

Returns the smaller single-precision value.

Returns

The smaller value, or NaN if either value is NaN.

Parameters

  • left: The first value.
  • right: The second value.

MoveToward(System.Double, System.Double, System.Double)

Kind: method

public static System.Double MoveToward(System.Double from, System.Double to, System.Double delta)

Summary

Moves a double-precision value toward a destination by a maximum delta.

Returns

The destination when within the step, otherwise the stepped value.

Parameters

  • from: The starting value.
  • to: The destination value.
  • delta: The step; a negative step moves away.

Exceptions

  • T:System.ArithmeticException: from or to makes the signed difference NaN.

MoveToward(System.Single, System.Single, System.Single)

Kind: method

public static System.Single MoveToward(System.Single from, System.Single to, System.Single delta)

Summary

Moves a value toward a destination by a maximum delta.

Returns

The destination when within the step, otherwise the stepped value.

Parameters

  • from: The starting value.
  • to: The destination value.
  • delta: The step; a negative step moves away.

Exceptions

  • T:System.ArithmeticException: from or to makes the signed difference NaN.

NearestPo2(System.Int32)

Kind: method

public static System.Int32 NearestPo2(System.Int32 value)

Summary

Returns the smallest representable power of two not less than a positive integer.

Returns

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.

Parameters

  • value: The input value.

PingPong(System.Double, System.Double)

Kind: method

public static System.Double PingPong(System.Double value, System.Double length)

Summary

Generates a double-precision triangle wave between zero and a length.

Returns

The reflected periodic value, or zero when length is zero.

Parameters

  • value: The wave position.
  • length: The endpoint magnitude; negative values behave like their positive magnitude.

PingPong(System.Single, System.Single)

Kind: method

public static System.Single PingPong(System.Single value, System.Single length)

Summary

Generates a triangle wave between zero and a length.

Returns

The reflected periodic value, or zero when length is zero.

Parameters

  • value: The wave position.
  • length: The endpoint magnitude; negative values behave like their positive magnitude.

PosMod(System.Double, System.Double)

Kind: method

public static System.Double PosMod(System.Double value, System.Double divisor)

Summary

Returns a canonical double-precision remainder with the divisor's sign.

Returns

A remainder in the divisor's direction; a zero divisor produces NaN.

Parameters

  • value: The dividend.
  • divisor: The divisor.

PosMod(System.Int32, System.Int32)

Kind: method

public static System.Int32 PosMod(System.Int32 value, System.Int32 divisor)

Summary

Returns a canonical integer remainder with the divisor's sign.

Returns

A remainder between zero and the divisor in the divisor's direction.

Parameters

  • value: The dividend.
  • divisor: The divisor.

Exceptions

  • T:System.DivideByZeroException: divisor is zero.
  • T:System.OverflowException: value is System.Int32.MinValue and divisor is negative one.

PosMod(System.Single, System.Single)

Kind: method

public static System.Single PosMod(System.Single value, System.Single divisor)

Summary

Returns a canonical single-precision remainder with the divisor's sign.

Returns

A remainder in the divisor's direction; a zero divisor produces NaN.

Parameters

  • value: The dividend.
  • divisor: The divisor.

Pow(System.Double, System.Double)

Kind: method

public static System.Double Pow(System.Double value, System.Double power)

Summary

Raises a double-precision value to a power.

Returns

The power result under IEEE 754 rules.

Parameters

  • value: The base.
  • power: The exponent.

Pow(System.Single, System.Single)

Kind: method

public static System.Single Pow(System.Single value, System.Single power)

Summary

Raises a value to a power.

Returns

The power result under IEEE 754 rules.

Parameters

  • value: The base.
  • power: The exponent.

RadToDeg(System.Double)

Kind: method

public static System.Double RadToDeg(System.Double radians)

Summary

Converts double-precision radians to degrees.

Returns

The angle in degrees.

Parameters

  • radians: The angle in radians.

RadToDeg(System.Single)

Kind: method

public static System.Single RadToDeg(System.Single radians)

Summary

Converts radians to degrees.

Returns

The angle in degrees.

Parameters

  • radians: The angle in radians.

Remap(System.Double, System.Double, System.Double, System.Double, System.Double)

Kind: method

public static System.Double Remap(System.Double value, System.Double inputFrom, System.Double inputTo, System.Double outputFrom, System.Double outputTo)

Summary

Maps a double-precision value linearly from one interval to another without clamping.

Returns

The mapped value; equal input bounds follow IEEE 754 division behavior.

Parameters

  • value: The input value.
  • inputFrom: The input interval start.
  • inputTo: The input interval end.
  • outputFrom: The output interval start.
  • outputTo: The output interval end.

Remap(System.Single, System.Single, System.Single, System.Single, System.Single)

Kind: method

public static System.Single Remap(System.Single value, System.Single inputFrom, System.Single inputTo, System.Single outputFrom, System.Single outputTo)

Summary

Maps a value linearly from one interval to another without clamping.

Returns

The mapped value; equal input bounds follow IEEE 754 division behavior.

Parameters

  • value: The input value.
  • inputFrom: The input interval start.
  • inputTo: The input interval end.
  • outputFrom: The output interval start.
  • outputTo: The output interval end.

RotateToward(System.Double, System.Double, System.Double)

Kind: method

public static System.Double RotateToward(System.Double from, System.Double to, System.Double delta)

Summary

Rotates a double-precision angle toward another angle without overshooting.

Returns

The stepped angle.

Parameters

  • from: The starting angle in radians.
  • to: The destination angle in radians.
  • delta: The step; a negative value rotates toward the opposite angle.

RotateToward(System.Single, System.Single, System.Single)

Kind: method

public static System.Single RotateToward(System.Single from, System.Single to, System.Single delta)

Summary

Rotates an angle toward another angle without overshooting.

Returns

The stepped angle.

Parameters

  • from: The starting angle in radians.
  • to: The destination angle in radians.
  • delta: The step; a negative value rotates toward the opposite angle.

Round(System.Double)

Kind: method

public static System.Double Round(System.Double value)

Summary

Rounds a double-precision value to the nearest integral value, with midpoint ties to even.

Returns

The rounded value.

Parameters

  • value: The input value.

Round(System.Single)

Kind: method

public static System.Single Round(System.Single value)

Summary

Rounds to the nearest integral floating-point value, with midpoint ties to even.

Returns

The rounded value.

Parameters

  • value: The input value.

RoundToInt(System.Double)

Kind: method

public static System.Int32 RoundToInt(System.Double value)

Summary

Rounds a double-precision value to the nearest integer, with midpoint ties to even.

Remarks

NaN, infinity, and an out-of-range result convert to the runtime-defined unchecked integer sentinel.

Returns

The rounded value converted using unchecked managed numeric conversion semantics.

Parameters

  • value: The input value.

RoundToInt(System.Single)

Kind: method

public static System.Int32 RoundToInt(System.Single value)

Summary

Rounds to the nearest integer, with midpoint ties to even.

Remarks

NaN, infinity, and an out-of-range result convert to the runtime-defined unchecked integer sentinel.

Returns

The rounded value converted using unchecked managed numeric conversion semantics.

Parameters

  • value: The input value.

Sign(System.Double)

Kind: method

public static System.Int32 Sign(System.Double value)

Summary

Returns negative one, zero, or positive one according to a double-precision value's sign.

Returns

The sign.

Parameters

  • value: The input value.

Exceptions

  • T:System.ArithmeticException: value is NaN.

Sign(System.Int32)

Kind: method

public static System.Int32 Sign(System.Int32 value)

Summary

Returns negative one, zero, or positive one according to an integer's sign.

Returns

The sign.

Parameters

  • value: The input value.

Sign(System.Single)

Kind: method

public static System.Int32 Sign(System.Single value)

Summary

Returns negative one, zero, or positive one according to a single-precision value's sign.

Returns

The sign.

Parameters

  • value: The input value.

Exceptions

  • T:System.ArithmeticException: value is NaN.

Sin(System.Double)

Kind: method

public static System.Double Sin(System.Double angle)

Summary

Returns the double-precision sine of an angle in radians.

Returns

The sine.

Parameters

  • angle: The angle in radians.

Sin(System.Single)

Kind: method

public static System.Single Sin(System.Single angle)

Summary

Returns the sine of an angle in radians.

Returns

The sine.

Parameters

  • angle: The angle in radians.

SinCos(System.Double)

Kind: method

public static System.ValueTuple<System.Double, System.Double> SinCos(System.Double angle)

Summary

Returns the double-precision sine and cosine of an angle in one operation.

Returns

A tuple containing sine followed by cosine.

Parameters

  • angle: The angle in radians.

SinCos(System.Single)

Kind: method

public static System.ValueTuple<System.Single, System.Single> SinCos(System.Single angle)

Summary

Returns the sine and cosine of an angle in one operation.

Returns

A tuple containing sine followed by cosine.

Parameters

  • angle: The angle in radians.

Sinh(System.Double)

Kind: method

public static System.Double Sinh(System.Double value)

Summary

Returns the double-precision hyperbolic sine.

Returns

The hyperbolic sine.

Parameters

  • value: The input value.

Sinh(System.Single)

Kind: method

public static System.Single Sinh(System.Single value)

Summary

Returns the hyperbolic sine.

Returns

The hyperbolic sine.

Parameters

  • value: The input value.

SmoothStep(System.Double, System.Double, System.Double)

Kind: method

public static System.Double SmoothStep(System.Double from, System.Double to, System.Double value)

Summary

Returns a double-precision cubic Hermite step between two edges.

Returns

A value from zero through one, or from when the edges are approximately equal.

Parameters

  • from: The first edge.
  • to: The second edge.
  • value: The value to normalize between the edges.

SmoothStep(System.Single, System.Single, System.Single)

Kind: method

public static System.Single SmoothStep(System.Single from, System.Single to, System.Single value)

Summary

Returns a cubic Hermite step between two edges.

Returns

A value from zero through one, or from when the edges are approximately equal.

Parameters

  • from: The first edge.
  • to: The second edge.
  • value: The value to normalize between the edges.

Snapped(System.Double, System.Double)

Kind: method

public static System.Double Snapped(System.Double value, System.Double step)

Summary

Snaps a double-precision value to the nearest multiple of a step.

Returns

floor(value / step + 0.5) * step.

Parameters

  • value: The value to snap.
  • step: The grid step; zero returns value unchanged.

Snapped(System.Single, System.Single)

Kind: method

public static System.Single Snapped(System.Single value, System.Single step)

Summary

Snaps a value to the nearest multiple of a step.

Returns

floor(value / step + 0.5) * step.

Parameters

  • value: The value to snap.
  • step: The grid step; zero returns value unchanged.

Sqrt(System.Double)

Kind: method

public static System.Double Sqrt(System.Double value)

Summary

Returns the double-precision principal square root.

Returns

The square root, or NaN for a negative input.

Parameters

  • value: A nonnegative value.

Sqrt(System.Single)

Kind: method

public static System.Single Sqrt(System.Single value)

Summary

Returns the principal square root.

Returns

The square root, or NaN for a negative input.

Parameters

  • value: A nonnegative value.

StepDecimals(System.Double)

Kind: method

public static System.Int32 StepDecimals(System.Double step)

Summary

Estimates the position of the first significant fractional decimal digit.

Returns

An index from zero through eight; integer and very small fractional inputs return zero.

Parameters

  • step: The input step.

Tan(System.Double)

Kind: method

public static System.Double Tan(System.Double angle)

Summary

Returns the double-precision tangent of an angle in radians.

Returns

The tangent.

Parameters

  • angle: The angle in radians.

Tan(System.Single)

Kind: method

public static System.Single Tan(System.Single angle)

Summary

Returns the tangent of an angle in radians.

Returns

The tangent.

Parameters

  • angle: The angle in radians.

Tanh(System.Double)

Kind: method

public static System.Double Tanh(System.Double value)

Summary

Returns the double-precision hyperbolic tangent.

Returns

The hyperbolic tangent.

Parameters

  • value: The input value.

Tanh(System.Single)

Kind: method

public static System.Single Tanh(System.Single value)

Summary

Returns the hyperbolic tangent.

Returns

The hyperbolic tangent.

Parameters

  • value: The input value.

Wrap(System.Double, System.Double, System.Double)

Kind: method

public static System.Double Wrap(System.Double value, System.Double min, System.Double max)

Summary

Wraps a double-precision value into a half-open interval.

Returns

The wrapped value, or min when the interval width is approximately zero.

Parameters

  • value: The value to wrap.
  • min: The inclusive lower bound.
  • max: The exclusive upper bound.

Wrap(System.Int32, System.Int32, System.Int32)

Kind: method

public static System.Int32 Wrap(System.Int32 value, System.Int32 min, System.Int32 max)

Summary

Wraps an integer into a half-open interval.

Remarks

Arithmetic uses unchecked 32-bit semantics; extreme bounds may overflow the interval width.

Returns

The wrapped value, or min when both bounds are equal.

Parameters

  • value: The value to wrap.
  • min: The inclusive lower bound.
  • max: The exclusive upper bound.

Exceptions

  • T:System.OverflowException: Unchecked bound arithmetic produces the exceptional System.Int32.MinValue remainder by negative one.

Wrap(System.Single, System.Single, System.Single)

Kind: method

public static System.Single Wrap(System.Single value, System.Single min, System.Single max)

Summary

Wraps a single-precision value into a half-open interval.

Returns

The wrapped value, or min when the interval width is approximately zero.

Parameters

  • value: The value to wrap.
  • min: The inclusive lower bound.
  • max: The exclusive upper bound.

Clone this wiki locally