Scalar

Summary

The math class containing scalar math operations

Definition

Namespace: SDT4.Managed.Core.Math
Assembly: SDT4.Managed.Core.dll

static class Scalar
Inheritance:

Object ➔ Scalar

Implements:


Fields

Name Type Description

Properties

Name Type Description

Methods

public static Single NormalizeAngle(Single angle)

Summary: Normalises an angle in radians to the range [-pi, pi].

Parameters:

Returns:


public static Single DeltaAngle(Single current, Single target)

Summary: Calculates the shortest angular difference in radians from a current angle to a target angle.

Parameters:

Returns:


public static Double NormalizeAngle(Double angle)

Summary: Normalises an angle in radians to the range [-pi, pi].

Parameters:

Returns:


public static Double DeltaAngle(Double current, Double target)

Summary: Calculates the shortest angular difference in radians from a current angle to a target angle.

Parameters:

Returns:


public static Single ToDeg(Single rad)

Summary: Converts an angle from radians to degrees.

Parameters:

Returns:


public static Single ToRad(Single deg)

Summary: Converts an angle from degrees to radians.

Parameters:

Returns:


public static Double ToDeg(Double rad)

Summary: Converts an angle from radians to degrees.

Parameters:

Returns:


public static Double ToRad(Double deg)

Summary: Converts an angle from degrees to radians.

Parameters:

Returns:


public static Boolean Approximately(Single a, Single b)

Summary: Determines whether two single-precision floating-point values are approximately equal within precision tolerance.

Parameters:

Returns:


public static Boolean Approximately(Single a, Single b, Single tolerance)

Summary: Determines whether two double-precision floating-point values are approximately equal within a given tolerance.

Parameters:

Returns:


public static Boolean IsBetween(Single v, Single min, Single max)

Summary: Determines whether a value lies within an inclusive range.

Parameters:

Returns:


public static Boolean IsBetweenExcl(Single v, Single min, Single max)

Summary: Determines whether a value lies strictly within an exclusive range.

Parameters:

Returns:


public static Boolean Approximately(Double a, Double b)

Summary: Determines whether two double-precision floating-point values are approximately equal within precision tolerance.

Parameters:

Returns:


public static Boolean Approximately(Double a, Double b, Double tolerance)

Summary: Determines whether two double-precision floating-point values are approximately equal within a given tolerance.

Parameters:

Returns:


public static Boolean IsBetween(Double v, Double min, Double max)

Summary: Determines whether a value lies within an inclusive range.

Parameters:

Returns:


public static Boolean IsBetweenExcl(Double v, Double min, Double max)

Summary: Determines whether a value lies strictly within an exclusive range.

Parameters:

Returns:


public static Single SmoothDamp(Single current, Single target, ref Single currentVelocity, Single smoothTime, Single maxSpeed, Single deltaTime)

Summary: Smoothly transitions a single-precision scalar value towards a target over time using critically damped spring dynamics.

Parameters:

Returns:


public static Double SmoothDamp(Double current, Double target, ref Double currentVelocity, Double smoothTime, Double maxSpeed, Single deltaTime)

Summary: Smoothly transitions a double-precision scalar value towards a target over time using critically damped spring dynamics.

Parameters:

Returns:


public static Single Clamp(Single v, Single min, Single max)

Summary: Clamps a single-precision value to a specified inclusive range.

Parameters:

Returns:


public static Single Min(Single a, Single b)

Summary: Returns the smaller of two single-precision values.

Parameters:

Returns:


public static Single Max(Single a, Single b)

Summary: Returns the larger of two single-precision values.

Parameters:

Returns:


public static Single Ceil(Single f)

Summary: Computes the smallest integral value that is greater than or equal to the specified single-precision number.

Parameters:

Returns:


public static Single Floor(Single f)

Summary: Computes the largest integral value that is less than or equal to the specified single-precision number.

Parameters:

Returns:


public static Single Round(Single f)

Summary: Rounds a single-precision value to the nearest integer.

Parameters:

Returns:


public static Single Saturate(Single v)

Summary: Clamps a single-precision value to the range [0, 1].

Parameters:

Returns:


public static Single Wrap(Single v, Single min, Single max)

Summary: Wraps a single-precision value into the range [min, max).

Parameters:

Returns:


public static Single PingPong(Single v, Single min, Single max)

Summary: Oscillates a single-precision value back and forth between a minimum and maximum range.

Parameters:

Returns:


public static Double Clamp(Double v, Double min, Double max)

Summary: Clamps a double-precision value to a specified inclusive range.

Parameters:

Returns:


public static Double Min(Double a, Double b)

Summary: Returns the smaller of two double-precision values.

Parameters:

Returns:


public static Double Max(Double a, Double b)

Summary: Returns the larger of two double-precision values.

Parameters:

Returns:


public static Double Ceil(Double f)

Summary: Computes the smallest integral value that is greater than or equal to the specified double-precision number.

Parameters:

Returns:


public static Double Floor(Double f)

Summary: Computes the largest integral value that is less than or equal to the specified double-precision number.

Parameters:

Returns:


public static Double Round(Double f)

Summary: Rounds a double-precision value to the nearest integer.

Parameters:

Returns:


public static Double Saturate(Double v)

Summary: Clamps a double-precision value to the range [0, 1].

Parameters:

Returns:


public static Double Wrap(Double v, Double min, Double max)

Summary: Wraps a double-precision value into the range [min, max).

Parameters:

Returns:


public static Double PingPong(Double v, Double min, Double max)

Summary: Oscillates a double-precision value back and forth between a minimum and maximum range.

Parameters:

Returns:


public static Single Sqrt(Single f)

Summary: Returns the square root of a single-precision number.

Parameters:

Returns:


public static Single Pow(Single f, Single p)

Summary: Raises a single-precision value to a specified power.

Parameters:

Returns:


public static Single Exp(Single power)

Summary: Returns e raised to the specified single-precision power.

Parameters:

Returns:


public static Single Log(Single f, Single p)

Summary: Computes the logarithm of a single-precision number in a specified base.

Parameters:

Returns:


public static Single Log(Single f)

Summary: Computes the natural (base e) logarithm of a single-precision number.

Parameters:

Returns:


public static Single Log10(Single f)

Summary: Computes the base-10 logarithm of a single-precision number.

Parameters:

Returns:


public static Double Sqrt(Double f)

Summary: Returns the square root of a double-precision number.

Parameters:

Returns:


public static Double Pow(Double f, Double p)

Summary: Raises a double-precision value to a specified power.

Parameters:

Returns:


public static Double Exp(Double power)

Summary: Returns e raised to the specified double-precision power.

Parameters:

Returns:


public static Double Log(Double f, Double p)

Summary: Computes the logarithm of a double-precision number in a specified base.

Parameters:

Returns:


public static Double Log(Double f)

Summary: Computes the natural (base e) logarithm of a double-precision number.

Parameters:

Returns:


public static Double Log10(Double f)

Summary: Computes the base-10 logarithm of a double-precision number.

Parameters:

Returns:


public static Single Lerp(Single a, Single b, Single t)

Summary: Performs a linear interpolation between two single-precision values.

Parameters:

Returns:


public static Single LerpAngle(Single a, Single b, Single t)

Summary: Interpolates linearly between two angles in radians, correctly wrapping around circle boundaries along the shortest path.

Parameters:

Returns:


public static Single InvLerp(Single a, Single b, Single x)

Summary: Calculates the inverse linear interpolation factor of a single-precision value within a given range.

Parameters:

Returns:


public static Single Map(Single srcStart, Single srcEnd, Single targetStart, Single targetEnd, Single x)

Summary: Remaps a single-precision value from an input range to a corresponding target range.

Parameters:

Returns:


public static Double Lerp(Double a, Double b, Double t)

Summary: Performs a linear interpolation between two double-precision values.

Parameters:

Returns:


public static Double LerpAngle(Double a, Double b, Double t)

Summary: Interpolates linearly between two angles in radians, correctly wrapping around circle boundaries along the shortest path.

Parameters:

Returns:


public static Double InvLerp(Double a, Double b, Double x)

Summary: Calculates the inverse linear interpolation factor of a double-precision value within a given range.

Parameters:

Returns:


public static Double Map(Double srcStart, Double srcEnd, Double targetStart, Double targetEnd, Double x)

Summary: Remaps a double-precision value from an input range to a corresponding target range.

Parameters:

Returns:


public static Single MoveTowards(Single current, Single target, Single maxDelta)

Summary: Advances a single-precision value towards a target by a maximum step delta without overshooting.

Parameters:

Returns:


public static Single MoveTowardsAngle(Single current, Single target, Single maxDelta)

Summary: Advances an angle in radians towards a target angle along the shortest circular path by a maximum step delta.

Parameters:

Returns:


public static Single Sign(Single value)

Summary: Returns the sign of a single-precision value, returning 1.0f for positive, -1.0f for negative, and 0.0f for zero.

Parameters:

Returns:


public static Single Abs(Single value)

Summary: Returns the absolute value of a single-precision number.

Parameters:

Returns:


public static Double Sign(Double value)

Summary: Returns the sign of a double-precision value, returning 1.0d for positive, -1.0d for negative, and 0.0d for zero.

Parameters:

Returns:


public static Double Abs(Double value)

Summary: Returns the absolute value of a double-precision number.

Parameters:

Returns:


public static Single Step(Single edge, Single x)

Summary: Generates a step function, returning 1.0f if the value exceeds the threshold edge; otherwise 0.0f.

Parameters:

Returns:


public static Single LinearStep(Single edgeMin, Single edgeMax, Single x)

Summary: Performs a clamped linear interpolation mapping an input value between two boundary edges to [0, 1].

Parameters:

Returns:


public static Single SmoothStep(Single edgeMin, Single edgeMax, Single x)

Summary: Performs smooth Hermite interpolation between 0 and 1 when an input value lies within the range [edgeMin, edgeMax].

Parameters:

Returns:


public static Single HardStep(Single edgeMin, Single edgeMax, Single x)

Summary: Evaluates a scaled, clamped hard step function across a range.

Parameters:

Returns:


public static Double Step(Double edge, Double x)

Summary: Generates a step function, returning 1.0d if the value exceeds the threshold edge; otherwise 0.0d.

Parameters:

Returns:


public static Double LinearStep(Double edgeMin, Double edgeMax, Double x)

Summary: Performs a clamped linear interpolation mapping an input value between two boundary edges to [0, 1].

Parameters:

Returns:


public static Double SmoothStep(Double edgeMin, Double edgeMax, Double x)

Summary: Performs smooth Hermite interpolation between 0 and 1 when an input value lies within the range [edgeMin, edgeMax].

Parameters:

Returns:


public static Double HardStep(Double edgeMin, Double edgeMax, Double x)

Summary: Evaluates a scaled, clamped hard step function across a range.

Parameters:

Returns:


public static Single Sin(Single f)

Summary: Returns the sine of the specified angle in radians.

Parameters:

Returns:


public static Single Cos(Single f)

Summary: Returns the cosine of the specified angle in radians.

Parameters:

Returns:


public static Single Tan(Single f)

Summary: Returns the tangent of the specified angle in radians.

Parameters:

Returns:


public static Single Asin(Single f)

Summary: Returns the angle in radians whose sine is the specified value.

Parameters:

Returns:


public static Single Acos(Single f)

Summary: Returns the angle in radians whose cosine is the specified value.

Parameters:

Returns:


public static Single Atan(Single f)

Summary: Returns the angle in radians whose tangent is the specified value.

Parameters:

Returns:


public static Single Atan2(Single y, Single x)

Summary: Returns the angle in radians whose tangent is the quotient of two specified numbers.

Parameters:

Returns:


public static Single Sinh(Single f)

Summary: Returns the hyperbolic sine of the specified value.

Parameters:

Returns:


public static Single Cosh(Single f)

Summary: Returns the hyperbolic cosine of the specified value.

Parameters:

Returns:


public static Single Tanh(Single f)

Summary: Returns the hyperbolic tangent of the specified value.

Parameters:

Returns:


public static Single Asinh(Single f)

Summary: Returns the angle whose hyperbolic sine is the specified value.

Parameters:

Returns:


public static Single Acosh(Single f)

Summary: Returns the angle whose hyperbolic cosine is the specified value.

Parameters:

Returns:


public static Single Atanh(Single f)

Summary: Returns the angle whose hyperbolic tangent is the specified value.

Parameters:

Returns:


public static Double Sin(Double f)

Summary: Returns the sine of the specified angle in radians.

Parameters:

Returns:


public static Double Cos(Double f)

Summary: Returns the cosine of the specified angle in radians.

Parameters:

Returns:


public static Double Tan(Double f)

Summary: Returns the tangent of the specified angle in radians.

Parameters:

Returns:


public static Double Asin(Double f)

Summary: Returns the angle in radians whose sine is the specified value.

Parameters:

Returns:


public static Double Acos(Double f)

Summary: Returns the angle in radians whose cosine is the specified value.

Parameters:

Returns:


public static Double Atan(Double f)

Summary: Returns the angle in radians whose tangent is the specified value.

Parameters:

Returns:


public static Double Atan2(Double y, Double x)

Summary: Returns the angle in radians whose tangent is the quotient of two specified numbers.

Parameters:

Returns:


public static Double Sinh(Double f)

Summary: Returns the hyperbolic sine of the specified value.

Parameters:

Returns:


public static Double Cosh(Double f)

Summary: Returns the hyperbolic cosine of the specified value.

Parameters:

Returns:


public static Double Tanh(Double f)

Summary: Returns the hyperbolic tangent of the specified value.

Parameters:

Returns:


public static Double Asinh(Double f)

Summary: Returns the angle whose hyperbolic sine is the specified value.

Parameters:

Returns:


public static Double Acosh(Double f)

Summary: Returns the angle whose hyperbolic cosine is the specified value.

Parameters:

Returns:


public static Double Atanh(Double f)

Summary: Returns the angle whose hyperbolic tangent is the specified value.

Parameters:

Returns: