reckfellENGINE

Mathf

Provides constants and static methods for common mathematical functions.

On this page
class MathfReckfellSharp

Provides constants and static methods for common mathematical functions.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Methods127

Abs3 overloads
# Abs · 1/3
C#
public static double Abs(double s);

Returns the absolute value of Color.S (i.e. positive value).

Parameters
NameTypeDefault
sdouble—
s

The input number.

Returns double

The absolute value of Color.S.

# Abs · 2/3
C#
public static int Abs(int s);

Returns the absolute value of Color.S (i.e. positive value).

Parameters
NameTypeDefault
sint—
s

The input number.

Returns int

The absolute value of Color.S.

# Abs · 3/3
C#
public static float Abs(float s);

Returns the absolute value of Color.S (i.e. positive value).

Parameters
NameTypeDefault
sfloat—
s

The input number.

Returns float

The absolute value of Color.S.

Acos2 overloads
# Acos · 1/2
C#
public static double Acos(double s);

Returns the arc cosine of Color.S in radians. Use to get the angle of cosine Color.S.

Parameters
NameTypeDefault
sdouble—
s

The input cosine value. Must be on the range of -1.0 to 1.0.

Returns double

An angle that would result in the given cosine value. On the range 0 to Tau/2.

# Acos · 2/2
C#
public static float Acos(float s);

Returns the arc cosine of Color.S in radians. Use to get the angle of cosine Color.S.

Parameters
NameTypeDefault
sfloat—
s

The input cosine value. Must be on the range of -1.0 to 1.0.

Returns float

An angle that would result in the given cosine value. On the range 0 to Tau/2.

Acosh2 overloads
# Acosh · 1/2
C#
public static double Acosh(double s);

Returns the hyperbolic arc (also called inverse) cosine of Color.S in radians. Use it to get the angle from an angle's cosine in hyperbolic space if Color.S is larger or equal to 1.

Parameters
NameTypeDefault
sdouble—
s

The input hyperbolic cosine value.

Returns double

An angle that would result in the given hyperbolic cosine value.

# Acosh · 2/2
C#
public static float Acosh(float s);

Returns the hyperbolic arc (also called inverse) cosine of Color.S in radians. Use it to get the angle from an angle's cosine in hyperbolic space if Color.S is larger or equal to 1.

Parameters
NameTypeDefault
sfloat—
s

The input hyperbolic cosine value.

Returns float

An angle that would result in the given hyperbolic cosine value.

AngleDifference2 overloads
# AngleDifference · 1/2
C#
public static double AngleDifference(double from, double to);

Returns the difference between the two angles, in range of -Mathf.Pi, Mathf.Pi. When PhysicsRayQueryParameters2D.From and PhysicsRayQueryParameters2D.To are opposite, returns -Mathf.Pi if from is smaller than to, or Mathf.Pi otherwise.

Parameters
NameTypeDefault
fromdouble—
todouble—
from

The start angle.

to

The destination angle.

Returns double

The difference between the two angles.

# AngleDifference · 2/2
C#
public static float AngleDifference(float from, float to);

Returns the difference between the two angles, in range of -Mathf.Pi, Mathf.Pi. When PhysicsRayQueryParameters2D.From and PhysicsRayQueryParameters2D.To are opposite, returns -Mathf.Pi if from is smaller than to, or Mathf.Pi otherwise.

Parameters
NameTypeDefault
fromfloat—
tofloat—
from

The start angle.

to

The destination angle.

Returns float

The difference between the two angles.

Asin2 overloads
# Asin · 1/2
C#
public static double Asin(double s);

Returns the arc sine of Color.S in radians. Use to get the angle of sine Color.S.

Parameters
NameTypeDefault
sdouble—
s

The input sine value. Must be on the range of -1.0 to 1.0.

Returns double

An angle that would result in the given sine value. On the range -Tau/4 to Tau/4.

# Asin · 2/2
C#
public static float Asin(float s);

Returns the arc sine of Color.S in radians. Use to get the angle of sine Color.S.

Parameters
NameTypeDefault
sfloat—
s

The input sine value. Must be on the range of -1.0 to 1.0.

Returns float

An angle that would result in the given sine value. On the range -Tau/4 to Tau/4.

Asinh2 overloads
# Asinh · 1/2
C#
public static double Asinh(double s);

Returns the hyperbolic arc (also called inverse) sine of Color.S in radians. Use it to get the angle from an angle's sine in hyperbolic space.

Parameters
NameTypeDefault
sdouble—
s

The input hyperbolic sine value.

Returns double

An angle that would result in the given hyperbolic sine value.

# Asinh · 2/2
C#
public static float Asinh(float s);

Returns the hyperbolic arc (also called inverse) sine of Color.S in radians. Use it to get the angle from an angle's sine in hyperbolic space.

Parameters
NameTypeDefault
sfloat—
s

The input hyperbolic sine value.

Returns float

An angle that would result in the given hyperbolic sine value.

Atan2 overloads
# Atan · 1/2
C#
public static double Atan(double s);

Returns the arc tangent of Color.S in radians. Use to get the angle of tangent Color.S.

The method cannot know in which quadrant the angle should fall. See Mathf.Atan2 if you have both y and x.

Parameters
NameTypeDefault
sdouble—
s

The input tangent value.

Returns double

An angle that would result in the given tangent value. On the range -Tau/4 to Tau/4.

# Atan · 2/2
C#
public static float Atan(float s);

Returns the arc tangent of Color.S in radians. Use to get the angle of tangent Color.S.

The method cannot know in which quadrant the angle should fall. See Mathf.Atan2 if you have both y and x.

Parameters
NameTypeDefault
sfloat—
s

The input tangent value.

Returns float

An angle that would result in the given tangent value. On the range -Tau/4 to Tau/4.

Atan22 overloads
# Atan2 · 1/2
C#
public static double Atan2(double y, double x);

Returns the arc tangent of Basis.Y and Basis.X in radians. Use to get the angle of the tangent of y/x. To compute the value, the method takes into account the sign of both arguments in order to determine the quadrant.

Important note: The Y coordinate comes first, by convention.

Parameters
NameTypeDefault
ydouble—
xdouble—
y

The Y coordinate of the point to find the angle to.

x

The X coordinate of the point to find the angle to.

Returns double

An angle that would result in the given tangent value. On the range -Tau/2 to Tau/2.

# Atan2 · 2/2
C#
public static float Atan2(float y, float x);

Returns the arc tangent of Basis.Y and Basis.X in radians. Use to get the angle of the tangent of y/x. To compute the value, the method takes into account the sign of both arguments in order to determine the quadrant.

Important note: The Y coordinate comes first, by convention.

Parameters
NameTypeDefault
yfloat—
xfloat—
y

The Y coordinate of the point to find the angle to.

x

The X coordinate of the point to find the angle to.

Returns float

An angle that would result in the given tangent value. On the range -Tau/2 to Tau/2.

Atanh2 overloads
# Atanh · 1/2
C#
public static double Atanh(double s);

Returns the hyperbolic arc (also called inverse) tangent of Color.S in radians. Use it to get the angle from an angle's tangent in hyperbolic space if Color.S is between -1 and 1 (non-inclusive).

Parameters
NameTypeDefault
sdouble—
s

The input hyperbolic tangent value.

Returns double

An angle that would result in the given hyperbolic tangent value.

# Atanh · 2/2
C#
public static float Atanh(float s);

Returns the hyperbolic arc (also called inverse) tangent of Color.S in radians. Use it to get the angle from an angle's tangent in hyperbolic space if Color.S is between -1 and 1 (non-inclusive).

Parameters
NameTypeDefault
sfloat—
s

The input hyperbolic tangent value.

Returns float

An angle that would result in the given hyperbolic tangent value.

BezierDerivative2 overloads
# BezierDerivative · 1/2
C#
public static double BezierDerivative(double start, double control1, double control2, double end, double t);

Returns the derivative at the given t on a one dimensional Bezier curve defined by the given control1, control2, and Aabb.End points.

Parameters
NameTypeDefault
startdouble—
control1double—
control2double—
enddouble—
tdouble—
start

The start value for the interpolation.

control1

Control point that defines the bezier curve.

control2

Control point that defines the bezier curve.

end

The destination value for the interpolation.

t

A value on the range of 0.0 to 1.0, representing the amount of interpolation.

Returns double

The resulting value of the interpolation.

# BezierDerivative · 2/2
C#
public static float BezierDerivative(float start, float control1, float control2, float end, float t);

Returns the derivative at the given t on a one dimensional Bezier curve defined by the given control1, control2, and Aabb.End points.

Parameters
NameTypeDefault
startfloat—
control1float—
control2float—
endfloat—
tfloat—
start

The start value for the interpolation.

control1

Control point that defines the bezier curve.

control2

Control point that defines the bezier curve.

end

The destination value for the interpolation.

t

A value on the range of 0.0 to 1.0, representing the amount of interpolation.

Returns float

The resulting value of the interpolation.

BezierInterpolate2 overloads
# BezierInterpolate · 1/2
C#
public static double BezierInterpolate(double start, double control1, double control2, double end, double t);

Returns the point at the given t on a one-dimensional Bezier curve defined by the given control1, control2, and Aabb.End points.

Parameters
NameTypeDefault
startdouble—
control1double—
control2double—
enddouble—
tdouble—
start

The start value for the interpolation.

control1

Control point that defines the bezier curve.

control2

Control point that defines the bezier curve.

end

The destination value for the interpolation.

t

A value on the range of 0.0 to 1.0, representing the amount of interpolation.

Returns double

The resulting value of the interpolation.

# BezierInterpolate · 2/2
C#
public static float BezierInterpolate(float start, float control1, float control2, float end, float t);

Returns the point at the given t on a one-dimensional Bezier curve defined by the given control1, control2, and Aabb.End points.

Parameters
NameTypeDefault
startfloat—
control1float—
control2float—
endfloat—
tfloat—
start

The start value for the interpolation.

control1

Control point that defines the bezier curve.

control2

Control point that defines the bezier curve.

end

The destination value for the interpolation.

t

A value on the range of 0.0 to 1.0, representing the amount of interpolation.

Returns float

The resulting value of the interpolation.

Ceil2 overloads
# Ceil · 1/2
C#
public static double Ceil(double s);

Rounds Color.S upward (towards positive infinity).

Parameters
NameTypeDefault
sdouble—
s

The number to ceil.

Returns double

The smallest whole number that is not less than Color.S.

# Ceil · 2/2
C#
public static float Ceil(float s);

Rounds Color.S upward (towards positive infinity).

Parameters
NameTypeDefault
sfloat—
s

The number to ceil.

Returns float

The smallest whole number that is not less than Color.S.

CeilToInt2 overloads
# CeilToInt · 1/2
C#
public static int CeilToInt(double s);

Rounds Color.S upward (towards positive infinity).

This is the same as Mathf.Ceil, but returns an int.

Parameters
NameTypeDefault
sdouble—
s

The number to ceil.

Returns int

The smallest whole number that is not less than Color.S.

# CeilToInt · 2/2
C#
public static int CeilToInt(float s);

Rounds Color.S upward (towards positive infinity).

This is the same as Mathf.Ceil, but returns an int.

Parameters
NameTypeDefault
sfloat—
s

The number to ceil.

Returns int

The smallest whole number that is not less than Color.S.

Clamp3 overloads
# Clamp · 1/3
C#
public static double Clamp(double value, double min, double max);

Clamps a Range.Value so that it is not less than Reckfell.Collections.Array.Min and not more than Reckfell.Collections.Array.Max.

Parameters
NameTypeDefault
valuedouble—
mindouble—
maxdouble—
value

The value to clamp.

min

The minimum allowed value.

max

The maximum allowed value.

Returns double

The clamped value.

# Clamp · 2/3
C#
public static int Clamp(int value, int min, int max);

Clamps a Range.Value so that it is not less than Reckfell.Collections.Array.Min and not more than Reckfell.Collections.Array.Max.

Parameters
NameTypeDefault
valueint—
minint—
maxint—
value

The value to clamp.

min

The minimum allowed value.

max

The maximum allowed value.

Returns int

The clamped value.

# Clamp · 3/3
C#
public static float Clamp(float value, float min, float max);

Clamps a Range.Value so that it is not less than Reckfell.Collections.Array.Min and not more than Reckfell.Collections.Array.Max.

Parameters
NameTypeDefault
valuefloat—
minfloat—
maxfloat—
value

The value to clamp.

min

The minimum allowed value.

max

The maximum allowed value.

Returns float

The clamped value.

Cos2 overloads
# Cos · 1/2
C#
public static double Cos(double s);

Returns the cosine of angle Color.S in radians.

Parameters
NameTypeDefault
sdouble—
s

The angle in radians.

Returns double

The cosine of that angle.

# Cos · 2/2
C#
public static float Cos(float s);

Returns the cosine of angle Color.S in radians.

Parameters
NameTypeDefault
sfloat—
s

The angle in radians.

Returns float

The cosine of that angle.

Cosh2 overloads
# Cosh · 1/2
C#
public static double Cosh(double s);

Returns the hyperbolic cosine of angle Color.S in radians.

Parameters
NameTypeDefault
sdouble—
s

The angle in radians.

Returns double

The hyperbolic cosine of that angle.

# Cosh · 2/2
C#
public static float Cosh(float s);

Returns the hyperbolic cosine of angle Color.S in radians.

Parameters
NameTypeDefault
sfloat—
s

The angle in radians.

Returns float

The hyperbolic cosine of that angle.

CubicInterpolate2 overloads
# CubicInterpolate · 1/2
C#
public static double CubicInterpolate(double from, double to, double pre, double post, double weight);

Cubic interpolates between two values by the factor defined in weight with pre and post values.

Parameters
NameTypeDefault
fromdouble—
todouble—
predouble—
postdouble—
weightdouble—
from

The start value for interpolation.

to

The destination value for interpolation.

pre

The value which before "from" value for interpolation.

post

The value which after "to" value for interpolation.

weight

A value on the range of 0.0 to 1.0, representing the amount of interpolation.

Returns double

The resulting value of the interpolation.

# CubicInterpolate · 2/2
C#
public static float CubicInterpolate(float from, float to, float pre, float post, float weight);

Cubic interpolates between two values by the factor defined in weight with pre and post values.

Parameters
NameTypeDefault
fromfloat—
tofloat—
prefloat—
postfloat—
weightfloat—
from

The start value for interpolation.

to

The destination value for interpolation.

pre

The value which before "from" value for interpolation.

post

The value which after "to" value for interpolation.

weight

A value on the range of 0.0 to 1.0, representing the amount of interpolation.

Returns float

The resulting value of the interpolation.

CubicInterpolateAngle2 overloads
# CubicInterpolateAngle · 1/2
C#
public static double CubicInterpolateAngle(double from, double to, double pre, double post, double weight);

Cubic interpolates between two rotation values with shortest path by the factor defined in weight with pre and post values. See also Mathf.LerpAngle.

Parameters
NameTypeDefault
fromdouble—
todouble—
predouble—
postdouble—
weightdouble—
from

The start value for interpolation.

to

The destination value for interpolation.

pre

The value which before "from" value for interpolation.

post

The value which after "to" value for interpolation.

weight

A value on the range of 0.0 to 1.0, representing the amount of interpolation.

Returns double

The resulting value of the interpolation.

# CubicInterpolateAngle · 2/2
C#
public static float CubicInterpolateAngle(float from, float to, float pre, float post, float weight);

Cubic interpolates between two rotation values with shortest path by the factor defined in weight with pre and post values. See also Mathf.LerpAngle.

Parameters
NameTypeDefault
fromfloat—
tofloat—
prefloat—
postfloat—
weightfloat—
from

The start value for interpolation.

to

The destination value for interpolation.

pre

The value which before "from" value for interpolation.

post

The value which after "to" value for interpolation.

weight

A value on the range of 0.0 to 1.0, representing the amount of interpolation.

Returns float

The resulting value of the interpolation.

CubicInterpolateAngleInTime2 overloads
# CubicInterpolateAngleInTime · 1/2
C#
public static double CubicInterpolateAngleInTime(double from, double to, double pre, double post, double weight, double toT, double preT, double postT);

Cubic interpolates between two rotation values with shortest path by the factor defined in weight with pre and post values. See also Mathf.LerpAngle. It can perform smoother interpolation than Mathf.CubicInterpolateAngle by the time values.

Parameters
NameTypeDefault
fromdouble—
todouble—
predouble—
postdouble—
weightdouble—
toTdouble—
preTdouble—
postTdouble—
from

The start value for interpolation.

to

The destination value for interpolation.

pre

The value which before "from" value for interpolation.

post

The value which after "to" value for interpolation.

weight

A value on the range of 0.0 to 1.0, representing the amount of interpolation.

Returns double

The resulting value of the interpolation.

# CubicInterpolateAngleInTime · 2/2
C#
public static float CubicInterpolateAngleInTime(float from, float to, float pre, float post, float weight, float toT, float preT, float postT);

Cubic interpolates between two rotation values with shortest path by the factor defined in weight with pre and post values. See also Mathf.LerpAngle. It can perform smoother interpolation than Mathf.CubicInterpolateAngle by the time values.

Parameters
NameTypeDefault
fromfloat—
tofloat—
prefloat—
postfloat—
weightfloat—
toTfloat—
preTfloat—
postTfloat—
from

The start value for interpolation.

to

The destination value for interpolation.

pre

The value which before "from" value for interpolation.

post

The value which after "to" value for interpolation.

weight

A value on the range of 0.0 to 1.0, representing the amount of interpolation.

Returns float

The resulting value of the interpolation.

CubicInterpolateInTime2 overloads
# CubicInterpolateInTime · 1/2
C#
public static double CubicInterpolateInTime(double from, double to, double pre, double post, double weight, double toT, double preT, double postT);

Cubic interpolates between two values by the factor defined in weight with pre and post values. It can perform smoother interpolation than Mathf.CubicInterpolate by the time values.

Parameters
NameTypeDefault
fromdouble—
todouble—
predouble—
postdouble—
weightdouble—
toTdouble—
preTdouble—
postTdouble—
from

The start value for interpolation.

to

The destination value for interpolation.

pre

The value which before "from" value for interpolation.

post

The value which after "to" value for interpolation.

weight

A value on the range of 0.0 to 1.0, representing the amount of interpolation.

Returns double

The resulting value of the interpolation.

# CubicInterpolateInTime · 2/2
C#
public static float CubicInterpolateInTime(float from, float to, float pre, float post, float weight, float toT, float preT, float postT);

Cubic interpolates between two values by the factor defined in weight with pre and post values. It can perform smoother interpolation than Mathf.CubicInterpolate by the time values.

Parameters
NameTypeDefault
fromfloat—
tofloat—
prefloat—
postfloat—
weightfloat—
toTfloat—
preTfloat—
postTfloat—
from

The start value for interpolation.

to

The destination value for interpolation.

pre

The value which before "from" value for interpolation.

post

The value which after "to" value for interpolation.

weight

A value on the range of 0.0 to 1.0, representing the amount of interpolation.

Returns float

The resulting value of the interpolation.

DbToLinear2 overloads
# DbToLinear · 1/2
C#
public static double DbToLinear(double db);

Converts from decibels to linear energy (audio).

Parameters
NameTypeDefault
dbdouble—
db

Decibels to convert.

Returns double

Audio volume as linear energy.

# DbToLinear · 2/2
C#
public static float DbToLinear(float db);

Converts from decibels to linear energy (audio).

Parameters
NameTypeDefault
dbfloat—
db

Decibels to convert.

Returns float

Audio volume as linear energy.

DecimalCount2 overloads
# DecimalCount · 1/2
C#
public static int DecimalCount(decimal s);

Returns the amount of digits after the decimal place.

Parameters
NameTypeDefault
sdecimal—
s

The input decimal value.

Returns int

The amount of digits.

# DecimalCount · 2/2
C#
public static int DecimalCount(double s);

Returns the amount of digits after the decimal place.

Parameters
NameTypeDefault
sdouble—
s

The input value.

Returns int

The amount of digits.

DegToRad2 overloads
# DegToRad · 1/2
C#
public static double DegToRad(double deg);

Converts an angle expressed in degrees to radians.

Parameters
NameTypeDefault
degdouble—
deg

An angle expressed in degrees.

Returns double

The same angle expressed in radians.

# DegToRad · 2/2
C#
public static float DegToRad(float deg);

Converts an angle expressed in degrees to radians.

Parameters
NameTypeDefault
degfloat—
deg

An angle expressed in degrees.

Returns float

The same angle expressed in radians.

Ease2 overloads
# Ease · 1/2
C#
public static double Ease(double s, double curve);

Returns an eased value of Color.S based on an exponential easing function defined with CurveTexture.Curve. The CurveTexture.Curve can be any floating-point number, with specific values leading to the following behaviors:

Lower than -1.0 (exclusive) Ease in-out.

Exactly -1.0 Linear.

Between -1.0 and 0.0 (exclusive) Ease out-in.

Exactly 0.0 Constant.

Between 0.0 and 1.0 (exclusive) Ease out.

Exactly 1.0 Linear.

Greater than 1.0 (exclusive) Ease in.

Parameters
NameTypeDefault
sdouble—
curvedouble—
s

The value to ease.

curve

The exponent defining the easing curve.

Returns double

The eased value.

# Ease · 2/2
C#
public static float Ease(float s, float curve);

Returns an eased value of Color.S based on an exponential easing function defined with CurveTexture.Curve. The CurveTexture.Curve can be any floating-point number, with specific values leading to the following behaviors:

Lower than -1.0 (exclusive) Ease in-out.

Exactly -1.0 Linear.

Between -1.0 and 0.0 (exclusive) Ease out-in.

Exactly 0.0 Constant.

Between 0.0 and 1.0 (exclusive) Ease out.

Exactly 1.0 Linear.

Greater than 1.0 (exclusive) Ease in.

Parameters
NameTypeDefault
sfloat—
curvefloat—
s

The value to ease.

curve

The exponent defining the easing curve.

Returns float

The eased value.

Exp2 overloads
# Exp · 1/2
C#
public static double Exp(double s);

The natural exponential function. It raises the mathematical constant e to the power of Color.S and returns it.

Parameters
NameTypeDefault
sdouble—
s

The exponent to raise e to.

Returns double

e raised to the power of Color.S.

# Exp · 2/2
C#
public static float Exp(float s);

The natural exponential function. It raises the mathematical constant e to the power of Color.S and returns it.

Parameters
NameTypeDefault
sfloat—
s

The exponent to raise e to.

Returns float

e raised to the power of Color.S.

Floor2 overloads
# Floor · 1/2
C#
public static double Floor(double s);

Rounds Color.S downward (towards negative infinity).

Parameters
NameTypeDefault
sdouble—
s

The number to floor.

Returns double

The largest whole number that is not more than Color.S.

# Floor · 2/2
C#
public static float Floor(float s);

Rounds Color.S downward (towards negative infinity).

Parameters
NameTypeDefault
sfloat—
s

The number to floor.

Returns float

The largest whole number that is not more than Color.S.

FloorToInt2 overloads
# FloorToInt · 1/2
C#
public static int FloorToInt(double s);

Rounds Color.S downward (towards negative infinity).

This is the same as Mathf.Floor, but returns an int.

Parameters
NameTypeDefault
sdouble—
s

The number to floor.

Returns int

The largest whole number that is not more than Color.S.

# FloorToInt · 2/2
C#
public static int FloorToInt(float s);

Rounds Color.S downward (towards negative infinity).

This is the same as Mathf.Floor, but returns an int.

Parameters
NameTypeDefault
sfloat—
s

The number to floor.

Returns int

The largest whole number that is not more than Color.S.

InverseLerp2 overloads
# InverseLerp · 1/2
C#
public static double InverseLerp(double from, double to, double weight);

Returns a normalized value considering the given range. This is the opposite of Mathf.Lerp.

Parameters
NameTypeDefault
fromdouble—
todouble—
weightdouble—
from

The start value for interpolation.

to

The destination value for interpolation.

weight

The interpolated value.

Returns double

The resulting value of the inverse interpolation. The returned value will be between 0.0 and 1.0 if weight is between PhysicsRayQueryParameters2D.From and PhysicsRayQueryParameters2D.To (inclusive).

# InverseLerp · 2/2
C#
public static float InverseLerp(float from, float to, float weight);

Returns a normalized value considering the given range. This is the opposite of Mathf.Lerp.

Parameters
NameTypeDefault
fromfloat—
tofloat—
weightfloat—
from

The start value for interpolation.

to

The destination value for interpolation.

weight

The interpolated value.

Returns float

The resulting value of the inverse interpolation. The returned value will be between 0.0 and 1.0 if weight is between PhysicsRayQueryParameters2D.From and PhysicsRayQueryParameters2D.To (inclusive).

IsEqualApprox4 overloads
# IsEqualApprox · 1/4
C#
public static bool IsEqualApprox(double a, double b);

Returns true if Color.A and Color.B are approximately equal to each other. The comparison is done using a tolerance calculation with Mathf.Epsilon.

Parameters
NameTypeDefault
adouble—
bdouble—
a

One of the values.

b

The other value.

Returns bool

A bool for whether or not the two values are approximately equal.

# IsEqualApprox · 2/4
C#
public static bool IsEqualApprox(double a, double b, double tolerance);

Returns true if Color.A and Color.B are approximately equal to each other. The comparison is done using the provided tolerance value. If you want the tolerance to be calculated for you, use Mathf.IsEqualApprox.

Parameters
NameTypeDefault
adouble—
bdouble—
tolerancedouble—
a

One of the values.

b

The other value.

tolerance

The pre-calculated tolerance value.

Returns bool

A bool for whether or not the two values are equal.

# IsEqualApprox · 3/4
C#
public static bool IsEqualApprox(float a, float b);

Returns true if Color.A and Color.B are approximately equal to each other. The comparison is done using a tolerance calculation with Mathf.Epsilon.

Parameters
NameTypeDefault
afloat—
bfloat—
a

One of the values.

b

The other value.

Returns bool

A bool for whether or not the two values are approximately equal.

# IsEqualApprox · 4/4
C#
public static bool IsEqualApprox(float a, float b, float tolerance);

Returns true if Color.A and Color.B are approximately equal to each other. The comparison is done using the provided tolerance value. If you want the tolerance to be calculated for you, use Mathf.IsEqualApprox.

Parameters
NameTypeDefault
afloat—
bfloat—
tolerancefloat—
a

One of the values.

b

The other value.

tolerance

The pre-calculated tolerance value.

Returns bool

A bool for whether or not the two values are equal.

IsFinite2 overloads
# IsFinite · 1/2
C#
public static bool IsFinite(double s);

Returns whether Color.S is a finite value, i.e. it is not Mathf.NaN, positive infinite, or negative infinity.

Parameters
NameTypeDefault
sdouble—
s

The value to check.

Returns bool

A bool for whether or not the value is a finite value.

# IsFinite · 2/2
C#
public static bool IsFinite(float s);

Returns whether Color.S is a finite value, i.e. it is not Mathf.NaN, positive infinite, or negative infinity.

Parameters
NameTypeDefault
sfloat—
s

The value to check.

Returns bool

A bool for whether or not the value is a finite value.

IsInf2 overloads
# IsInf · 1/2
C#
public static bool IsInf(double s);

Returns whether Color.S is an infinity value (either positive infinity or negative infinity).

Parameters
NameTypeDefault
sdouble—
s

The value to check.

Returns bool

A bool for whether or not the value is an infinity value.

# IsInf · 2/2
C#
public static bool IsInf(float s);

Returns whether Color.S is an infinity value (either positive infinity or negative infinity).

Parameters
NameTypeDefault
sfloat—
s

The value to check.

Returns bool

A bool for whether or not the value is an infinity value.

IsNaN2 overloads
# IsNaN · 1/2
C#
public static bool IsNaN(double s);

Returns whether Color.S is a NaN ("Not a Number" or invalid) value.

Parameters
NameTypeDefault
sdouble—
s

The value to check.

Returns bool

A bool for whether or not the value is a NaN value.

# IsNaN · 2/2
C#
public static bool IsNaN(float s);

Returns whether Color.S is a NaN ("Not a Number" or invalid) value.

Parameters
NameTypeDefault
sfloat—
s

The value to check.

Returns bool

A bool for whether or not the value is a NaN value.

IsZeroApprox2 overloads
# IsZeroApprox · 1/2
C#
public static bool IsZeroApprox(double s);

Returns true if Color.S is zero or almost zero. The comparison is done using a tolerance calculation with Mathf.Epsilon.

This method is faster than using Mathf.IsEqualApprox with one value as zero.

Parameters
NameTypeDefault
sdouble—
s

The value to check.

Returns bool

A bool for whether or not the value is nearly zero.

# IsZeroApprox · 2/2
C#
public static bool IsZeroApprox(float s);

Returns true if Color.S is zero or almost zero. The comparison is done using a tolerance calculation with Mathf.Epsilon.

This method is faster than using Mathf.IsEqualApprox with one value as zero.

Parameters
NameTypeDefault
sfloat—
s

The value to check.

Returns bool

A bool for whether or not the value is nearly zero.

Lerp2 overloads
# Lerp · 1/2
C#
public static double Lerp(double from, double to, double weight);

Linearly interpolates between two values by a normalized value. This is the opposite Mathf.InverseLerp.

Parameters
NameTypeDefault
fromdouble—
todouble—
weightdouble—
from

The start value for interpolation.

to

The destination value for interpolation.

weight

A value on the range of 0.0 to 1.0, representing the amount of interpolation.

Returns double

The resulting value of the interpolation.

# Lerp · 2/2
C#
public static float Lerp(float from, float to, float weight);

Linearly interpolates between two values by a normalized value. This is the opposite Mathf.InverseLerp.

Parameters
NameTypeDefault
fromfloat—
tofloat—
weightfloat—
from

The start value for interpolation.

to

The destination value for interpolation.

weight

A value on the range of 0.0 to 1.0, representing the amount of interpolation.

Returns float

The resulting value of the interpolation.

LerpAngle2 overloads
# LerpAngle · 1/2
C#
public static double LerpAngle(double from, double to, double weight);

Linearly interpolates between two angles (in radians) by a normalized value.

Similar to Mathf.Lerp, but interpolates correctly when the angles wrap around Mathf.Tau.

Parameters
NameTypeDefault
fromdouble—
todouble—
weightdouble—
from

The start angle for interpolation.

to

The destination angle for interpolation.

weight

A value on the range of 0.0 to 1.0, representing the amount of interpolation.

Returns double

The resulting angle of the interpolation.

# LerpAngle · 2/2
C#
public static float LerpAngle(float from, float to, float weight);

Linearly interpolates between two angles (in radians) by a normalized value.

Similar to Mathf.Lerp, but interpolates correctly when the angles wrap around Mathf.Tau.

Parameters
NameTypeDefault
fromfloat—
tofloat—
weightfloat—
from

The start angle for interpolation.

to

The destination angle for interpolation.

weight

A value on the range of 0.0 to 1.0, representing the amount of interpolation.

Returns float

The resulting angle of the interpolation.

LinearToDb2 overloads
# LinearToDb · 1/2
C#
public static double LinearToDb(double linear);

Converts from linear energy to decibels (audio). This can be used to implement volume sliders that behave as expected (since volume isn't linear).

Parameters
NameTypeDefault
lineardouble—
linear

The linear energy to convert.

Returns double

Audio as decibels.

# LinearToDb · 2/2
C#
public static float LinearToDb(float linear);

Converts from linear energy to decibels (audio). This can be used to implement volume sliders that behave as expected (since volume isn't linear).

Parameters
NameTypeDefault
linearfloat—
linear

The linear energy to convert.

Returns float

Audio as decibels.

Log2 overloads
# Log · 1/2
C#
public static double Log(double s);

Natural logarithm. The amount of time needed to reach a certain level of continuous growth.

Note: This is not the same as the "log" function on most calculators, which uses a base 10 logarithm.

Parameters
NameTypeDefault
sdouble—
s

The input value.

Returns double

The natural log of Color.S.

# Log · 2/2
C#
public static float Log(float s);

Natural logarithm. The amount of time needed to reach a certain level of continuous growth.

Note: This is not the same as the "log" function on most calculators, which uses a base 10 logarithm.

Parameters
NameTypeDefault
sfloat—
s

The input value.

Returns float

The natural log of Color.S.

Max3 overloads
# Max · 1/3
C#
public static double Max(double a, double b);

Returns the maximum of two values.

Parameters
NameTypeDefault
adouble—
bdouble—
a

One of the values.

b

The other value.

Returns double

Whichever of the two values is higher.

# Max · 2/3
C#
public static int Max(int a, int b);

Returns the maximum of two values.

Parameters
NameTypeDefault
aint—
bint—
a

One of the values.

b

The other value.

Returns int

Whichever of the two values is higher.

# Max · 3/3
C#
public static float Max(float a, float b);

Returns the maximum of two values.

Parameters
NameTypeDefault
afloat—
bfloat—
a

One of the values.

b

The other value.

Returns float

Whichever of the two values is higher.

Min3 overloads
# Min · 1/3
C#
public static double Min(double a, double b);

Returns the minimum of two values.

Parameters
NameTypeDefault
adouble—
bdouble—
a

One of the values.

b

The other value.

Returns double

Whichever of the two values is lower.

# Min · 2/3
C#
public static int Min(int a, int b);

Returns the minimum of two values.

Parameters
NameTypeDefault
aint—
bint—
a

One of the values.

b

The other value.

Returns int

Whichever of the two values is lower.

# Min · 3/3
C#
public static float Min(float a, float b);

Returns the minimum of two values.

Parameters
NameTypeDefault
afloat—
bfloat—
a

One of the values.

b

The other value.

Returns float

Whichever of the two values is lower.

MoveToward2 overloads
# MoveToward · 1/2
C#
public static double MoveToward(double from, double to, double delta);

Moves PhysicsRayQueryParameters2D.From toward PhysicsRayQueryParameters2D.To by the InputEventPanGesture.Delta value.

Use a negative InputEventPanGesture.Delta value to move away.

Parameters
NameTypeDefault
fromdouble—
todouble—
deltadouble—
from

The start value.

to

The value to move towards.

delta

The amount to move by.

Returns double

The value after moving.

# MoveToward · 2/2
C#
public static float MoveToward(float from, float to, float delta);

Moves PhysicsRayQueryParameters2D.From toward PhysicsRayQueryParameters2D.To by the InputEventPanGesture.Delta value.

Use a negative InputEventPanGesture.Delta value to move away.

Parameters
NameTypeDefault
fromfloat—
tofloat—
deltafloat—
from

The start value.

to

The value to move towards.

delta

The amount to move by.

Returns float

The value after moving.

NearestPo2int
# NearestPo2
C#
public static int NearestPo2(int value);

Returns the nearest larger power of 2 for the integer Range.Value.

Parameters
NameTypeDefault
valueint—
value

The input value.

Returns int

The nearest larger power of 2.

PingPong2 overloads
# PingPong · 1/2
C#
public static double PingPong(double value, double length);

Returns the Range.Value wrapped between 0 and the Animation.Length. If the limit is reached, the next value the function returned is decreased to the 0 side or increased to the Animation.Length side (like a triangle wave). If Animation.Length is less than zero, it becomes positive.

Parameters
NameTypeDefault
valuedouble—
lengthdouble—
value

The value to pingpong.

length

The maximum value of the function.

Returns double

The ping-ponged value.

# PingPong · 2/2
C#
public static float PingPong(float value, float length);

Returns the Range.Value wrapped between 0 and the Animation.Length. If the limit is reached, the next value the function returned is decreased to the 0 side or increased to the Animation.Length side (like a triangle wave). If Animation.Length is less than zero, it becomes positive.

Parameters
NameTypeDefault
valuefloat—
lengthfloat—
value

The value to pingpong.

length

The maximum value of the function.

Returns float

The ping-ponged value.

PosMod3 overloads
# PosMod · 1/3
C#
public static double PosMod(double a, double b);

Returns the floating-point modulus of Color.A divided by Color.B that wraps equally in positive and negative.

Parameters
NameTypeDefault
adouble—
bdouble—
a

The dividend, the primary input.

b

The divisor.

Returns double

The resulting output.

# PosMod · 2/3
C#
public static int PosMod(int a, int b);

Returns the integer modulus of Color.A divided by Color.B that wraps equally in positive and negative.

Parameters
NameTypeDefault
aint—
bint—
a

The dividend, the primary input.

b

The divisor.

Returns int

The resulting output.

# PosMod · 3/3
C#
public static float PosMod(float a, float b);

Returns the floating-point modulus of Color.A divided by Color.B that wraps equally in positive and negative.

Parameters
NameTypeDefault
afloat—
bfloat—
a

The dividend, the primary input.

b

The divisor.

Returns float

The resulting output.

Pow2 overloads
# Pow · 1/2
C#
public static double Pow(double x, double y);

Returns the result of Basis.X raised to the power of Basis.Y.

Parameters
NameTypeDefault
xdouble—
ydouble—
x

The base.

y

The exponent.

Returns double

Basis.X raised to the power of Basis.Y.

# Pow · 2/2
C#
public static float Pow(float x, float y);

Returns the result of Basis.X raised to the power of Basis.Y.

Parameters
NameTypeDefault
xfloat—
yfloat—
x

The base.

y

The exponent.

Returns float

Basis.X raised to the power of Basis.Y.

RadToDeg2 overloads
# RadToDeg · 1/2
C#
public static double RadToDeg(double rad);

Converts an angle expressed in radians to degrees.

Parameters
NameTypeDefault
raddouble—
rad

An angle expressed in radians.

Returns double

The same angle expressed in degrees.

# RadToDeg · 2/2
C#
public static float RadToDeg(float rad);

Converts an angle expressed in radians to degrees.

Parameters
NameTypeDefault
radfloat—
rad

An angle expressed in radians.

Returns float

The same angle expressed in degrees.

Remap2 overloads
# Remap · 1/2
C#
public static double Remap(double value, double inFrom, double inTo, double outFrom, double outTo);

Maps a Range.Value from [inFrom, inTo] to [outFrom, outTo].

Parameters
NameTypeDefault
valuedouble—
inFromdouble—
inTodouble—
outFromdouble—
outTodouble—
value

The value to map.

inFrom

The start value for the input interpolation.

inTo

The destination value for the input interpolation.

outFrom

The start value for the output interpolation.

outTo

The destination value for the output interpolation.

Returns double

The resulting mapped value mapped.

# Remap · 2/2
C#
public static float Remap(float value, float inFrom, float inTo, float outFrom, float outTo);

Maps a Range.Value from [inFrom, inTo] to [outFrom, outTo].

Parameters
NameTypeDefault
valuefloat—
inFromfloat—
inTofloat—
outFromfloat—
outTofloat—
value

The value to map.

inFrom

The start value for the input interpolation.

inTo

The destination value for the input interpolation.

outFrom

The start value for the output interpolation.

outTo

The destination value for the output interpolation.

Returns float

The resulting mapped value mapped.

RotateToward2 overloads
# RotateToward · 1/2
C#
public static double RotateToward(double from, double to, double delta);

Rotates PhysicsRayQueryParameters2D.From toward PhysicsRayQueryParameters2D.To by the InputEventPanGesture.Delta amount. Will not go past PhysicsRayQueryParameters2D.To. Similar to Mathf.MoveToward but interpolates correctly when the angles wrap around Mathf.Tau. If InputEventPanGesture.Delta is negative, this function will rotate away from PhysicsRayQueryParameters2D.To, toward the opposite angle, and will not go past the opposite angle.

Parameters
NameTypeDefault
fromdouble—
todouble—
deltadouble—
from

The start angle.

to

The angle to move towards.

delta

The amount to move by.

Returns double

The angle after moving.

# RotateToward · 2/2
C#
public static float RotateToward(float from, float to, float delta);

Rotates PhysicsRayQueryParameters2D.From toward PhysicsRayQueryParameters2D.To by the InputEventPanGesture.Delta amount. Will not go past PhysicsRayQueryParameters2D.To. Similar to Mathf.MoveToward but interpolates correctly when the angles wrap around Mathf.Tau. If InputEventPanGesture.Delta is negative, this function will rotate away from PhysicsRayQueryParameters2D.To, toward the opposite angle, and will not go past the opposite angle.

Parameters
NameTypeDefault
fromfloat—
tofloat—
deltafloat—
from

The start angle.

to

The angle to move towards.

delta

The amount to move by.

Returns float

The angle after moving.

Round2 overloads
# Round · 1/2
C#
public static double Round(double s);

Rounds Color.S to the nearest whole number, with halfway cases rounded towards the nearest multiple of two.

Parameters
NameTypeDefault
sdouble—
s

The number to round.

Returns double

The rounded number.

# Round · 2/2
C#
public static float Round(float s);

Rounds Color.S to the nearest whole number, with halfway cases rounded towards the nearest multiple of two.

Parameters
NameTypeDefault
sfloat—
s

The number to round.

Returns float

The rounded number.

RoundToInt2 overloads
# RoundToInt · 1/2
C#
public static int RoundToInt(double s);

Rounds Color.S to the nearest whole number.

This is the same as Mathf.Round, but returns an int.

Parameters
NameTypeDefault
sdouble—
s

The number to round.

Returns int

The rounded number.

# RoundToInt · 2/2
C#
public static int RoundToInt(float s);

Rounds Color.S to the nearest whole number.

This is the same as Mathf.Round, but returns an int.

Parameters
NameTypeDefault
sfloat—
s

The number to round.

Returns int

The rounded number.

Sign3 overloads
# Sign · 1/3
C#
public static int Sign(double s);

Returns the sign of Color.S: -1 or 1. Returns 0 if Color.S is 0.

Parameters
NameTypeDefault
sdouble—
s

The input number.

Returns int

One of three possible values: 1, -1, or 0.

# Sign · 2/3
C#
public static int Sign(int s);

Returns the sign of Color.S: -1 or 1. Returns 0 if Color.S is 0.

Parameters
NameTypeDefault
sint—
s

The input number.

Returns int

One of three possible values: 1, -1, or 0.

# Sign · 3/3
C#
public static int Sign(float s);

Returns the sign of Color.S: -1 or 1. Returns 0 if Color.S is 0.

Parameters
NameTypeDefault
sfloat—
s

The input number.

Returns int

One of three possible values: 1, -1, or 0.

Sin2 overloads
# Sin · 1/2
C#
public static double Sin(double s);

Returns the sine of angle Color.S in radians.

Parameters
NameTypeDefault
sdouble—
s

The angle in radians.

Returns double

The sine of that angle.

# Sin · 2/2
C#
public static float Sin(float s);

Returns the sine of angle Color.S in radians.

Parameters
NameTypeDefault
sfloat—
s

The angle in radians.

Returns float

The sine of that angle.

SinCos2 overloads
# SinCos · 1/2
C#
public static ValueTuple<double, double> SinCos(double s);

Returns the sine and cosine of angle Color.S in radians.

Parameters
NameTypeDefault
sdouble—
s

The angle in radians.

Returns ValueTuple<double, double>

The sine and cosine of that angle.

# SinCos · 2/2
C#
public static ValueTuple<float, float> SinCos(float s);

Returns the sine and cosine of angle Color.S in radians.

Parameters
NameTypeDefault
sfloat—
s

The angle in radians.

Returns ValueTuple<float, float>

The sine and cosine of that angle.

Sinh2 overloads
# Sinh · 1/2
C#
public static double Sinh(double s);

Returns the hyperbolic sine of angle Color.S in radians.

Parameters
NameTypeDefault
sdouble—
s

The angle in radians.

Returns double

The hyperbolic sine of that angle.

# Sinh · 2/2
C#
public static float Sinh(float s);

Returns the hyperbolic sine of angle Color.S in radians.

Parameters
NameTypeDefault
sfloat—
s

The angle in radians.

Returns float

The hyperbolic sine of that angle.

SmoothStep2 overloads
# SmoothStep · 1/2
C#
public static double SmoothStep(double from, double to, double weight);

Returns a smooth cubic Hermite interpolation factor between 0.0 and 1.0 based on weight within the range from PhysicsRayQueryParameters2D.From to PhysicsRayQueryParameters2D.To. The interpolation is slowest at the beginning and end of the range, and fastest halfway through.

For positive ranges (when PhysicsRayQueryParameters2D.From is less than PhysicsRayQueryParameters2D.To):

Less than or equal to PhysicsRayQueryParameters2D.From Returns 0.

Between PhysicsRayQueryParameters2D.From and PhysicsRayQueryParameters2D.To (exclusive) Returns an S-shaped curve that smoothly transitions from 0 to 1.

Greater than or equal to PhysicsRayQueryParameters2D.To Returns 1.

For negative ranges (when PhysicsRayQueryParameters2D.From is greater than PhysicsRayQueryParameters2D.To):

Less than or equal to PhysicsRayQueryParameters2D.To Returns 1.

Between PhysicsRayQueryParameters2D.To and PhysicsRayQueryParameters2D.From (exclusive) Returns a mirrored S-shaped curve that smoothly transitions from 1 to 0.

Greater than or equal to PhysicsRayQueryParameters2D.From Returns 0.

For empty ranges (when PhysicsRayQueryParameters2D.From equals PhysicsRayQueryParameters2D.To):

Less than or equal to PhysicsRayQueryParameters2D.From Returns 0.

Greater than PhysicsRayQueryParameters2D.From Returns 1.

Parameters
NameTypeDefault
fromdouble—
todouble—
weightdouble—
from

The start value for interpolation.

to

The destination value for interpolation.

weight

A value representing the amount of interpolation.

Returns double

The resulting value of the interpolation.

# SmoothStep · 2/2
C#
public static float SmoothStep(float from, float to, float weight);

Returns a smooth cubic Hermite interpolation factor between 0.0 and 1.0 based on weight within the range from PhysicsRayQueryParameters2D.From to PhysicsRayQueryParameters2D.To. The interpolation is slowest at the beginning and end of the range, and fastest halfway through.

For positive ranges (when PhysicsRayQueryParameters2D.From is less than PhysicsRayQueryParameters2D.To):

Less than or equal to PhysicsRayQueryParameters2D.From Returns 0.

Between PhysicsRayQueryParameters2D.From and PhysicsRayQueryParameters2D.To (exclusive) Returns an S-shaped curve that smoothly transitions from 0 to 1.

Greater than or equal to PhysicsRayQueryParameters2D.To Returns 1.

For negative ranges (when PhysicsRayQueryParameters2D.From is greater than PhysicsRayQueryParameters2D.To):

Less than or equal to PhysicsRayQueryParameters2D.To Returns 1.

Between PhysicsRayQueryParameters2D.To and PhysicsRayQueryParameters2D.From (exclusive) Returns a mirrored S-shaped curve that smoothly transitions from 1 to 0.

Greater than or equal to PhysicsRayQueryParameters2D.From Returns 0.

For empty ranges (when PhysicsRayQueryParameters2D.From equals PhysicsRayQueryParameters2D.To):

Less than or equal to PhysicsRayQueryParameters2D.From Returns 0.

Greater than PhysicsRayQueryParameters2D.From Returns 1.

Parameters
NameTypeDefault
fromfloat—
tofloat—
weightfloat—
from

The start value for interpolation.

to

The destination value for interpolation.

weight

A value representing the amount of interpolation.

Returns float

The resulting value of the interpolation.

Snapped2 overloads
# Snapped · 1/2
C#
public static double Snapped(double s, double step);

Snaps float value Color.S to a given Animation.Step. This can also be used to round a floating point number to an arbitrary number of decimals.

Parameters
NameTypeDefault
sdouble—
stepdouble—
s

The value to snap.

step

The step size to snap to.

Returns double

The snapped value.

# Snapped · 2/2
C#
public static float Snapped(float s, float step);

Snaps float value Color.S to a given Animation.Step. This can also be used to round a floating point number to an arbitrary number of decimals.

Parameters
NameTypeDefault
sfloat—
stepfloat—
s

The value to snap.

step

The step size to snap to.

Returns float

The snapped value.

Sqrt2 overloads
# Sqrt · 1/2
C#
public static double Sqrt(double s);

Returns the square root of Color.S, where Color.S is a non-negative number.

If you need negative inputs, use System.Numerics.Complex.

Parameters
NameTypeDefault
sdouble—
s

The input number. Must not be negative.

Returns double

The square root of Color.S.

# Sqrt · 2/2
C#
public static float Sqrt(float s);

Returns the square root of Color.S, where Color.S is a non-negative number.

If you need negative inputs, use System.Numerics.Complex.

Parameters
NameTypeDefault
sfloat—
s

The input number. Must not be negative.

Returns float

The square root of Color.S.

StepDecimalsint
# StepDecimals
C#
public static int StepDecimals(double step);

Returns the position of the first non-zero digit, after the decimal point. Note that the maximum return value is 10, which is a design decision in the implementation.

Parameters
NameTypeDefault
stepdouble—
step

The input value.

Returns int

The position of the first non-zero digit.

Tan2 overloads
# Tan · 1/2
C#
public static double Tan(double s);

Returns the tangent of angle Color.S in radians.

Parameters
NameTypeDefault
sdouble—
s

The angle in radians.

Returns double

The tangent of that angle.

# Tan · 2/2
C#
public static float Tan(float s);

Returns the tangent of angle Color.S in radians.

Parameters
NameTypeDefault
sfloat—
s

The angle in radians.

Returns float

The tangent of that angle.

Tanh2 overloads
# Tanh · 1/2
C#
public static double Tanh(double s);

Returns the hyperbolic tangent of angle Color.S in radians.

Parameters
NameTypeDefault
sdouble—
s

The angle in radians.

Returns double

The hyperbolic tangent of that angle.

# Tanh · 2/2
C#
public static float Tanh(float s);

Returns the hyperbolic tangent of angle Color.S in radians.

Parameters
NameTypeDefault
sfloat—
s

The angle in radians.

Returns float

The hyperbolic tangent of that angle.

Wrap3 overloads
# Wrap · 1/3
C#
public static double Wrap(double value, double min, double max);

Wraps Range.Value between Reckfell.Collections.Array.Min and Reckfell.Collections.Array.Max. Usable for creating loop-alike behavior or infinite surfaces. If Reckfell.Collections.Array.Min is 0, this is equivalent to Mathf.PosMod, so prefer using that instead.

Parameters
NameTypeDefault
valuedouble—
mindouble—
maxdouble—
value

The value to wrap.

min

The minimum allowed value and lower bound of the range.

max

The maximum allowed value and upper bound of the range.

Returns double

The wrapped value.

# Wrap · 2/3
C#
public static int Wrap(int value, int min, int max);

Wraps Range.Value between Reckfell.Collections.Array.Min and Reckfell.Collections.Array.Max. Usable for creating loop-alike behavior or infinite surfaces. If Reckfell.Collections.Array.Min is 0, this is equivalent to Mathf.PosMod, so prefer using that instead.

Parameters
NameTypeDefault
valueint—
minint—
maxint—
value

The value to wrap.

min

The minimum allowed value and lower bound of the range.

max

The maximum allowed value and upper bound of the range.

Returns int

The wrapped value.

# Wrap · 3/3
C#
public static float Wrap(float value, float min, float max);

Wraps Range.Value between Reckfell.Collections.Array.Min and Reckfell.Collections.Array.Max. Usable for creating loop-alike behavior or infinite surfaces. If Reckfell.Collections.Array.Min is 0, this is equivalent to Mathf.PosMod, so prefer using that instead.

Parameters
NameTypeDefault
valuefloat—
minfloat—
maxfloat—
value

The value to wrap.

min

The minimum allowed value and lower bound of the range.

max

The maximum allowed value and upper bound of the range.

Returns float

The wrapped value.

Fields and constants7

EField
# E
C#
public const float E = 2.7182817f;

The natural number e.

EpsilonField
# Epsilon
C#
public const float Epsilon = 1E-06f;

A very small number used for float comparison with error tolerance. 1e-06 with single-precision floats, but 1e-14 if REAL_T_IS_DOUBLE.

InfField
# Inf
C#
public const float Inf = float.PositiveInfinity;

Positive infinity. For negative infinity, use -Mathf.Inf.

NaNField
# NaN
C#
public const float NaN = float.NaN;

"Not a Number", an invalid value. NaN has special properties, including that it is not equal to itself. It is output by some invalid operations, such as dividing zero by zero.

PiField
# Pi
C#
public const float Pi = 3.1415927f;

Constant that represents how many times the diameter of a circle fits around its perimeter. This is equivalent to Mathf.Tau / 2.

Sqrt2Field
# Sqrt2
C#
public const float Sqrt2 = 1.4142135f;

The square root of 2.

TauField
# Tau
C#
public const float Tau = 6.2831855f;

The circle constant, the circumference of the unit circle in radians.

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.