Skip to content
Eduard Gushchin edited this page Jun 24, 2026 · 5 revisions

Home | API by Category | Complete API Index | API Compatibility

Field Value
Full name Electron2D.Mathf
Namespace Electron2D
Kind class
Category Math and Data

Overview

Represents the mathf type.

Syntax

public static class Electron2D.Mathf

Godot 4.7 C# profile compatibility

Profile: Electron2D 0.1.0 2D
Status: Partial / Not verified
Out of profile: yes
Godot reference: Mathf

Basic constants, approximate comparison, clamp, interpolation, angle conversion, modulo and snapping helpers.

Remarks

This type is part of the Electron2D 0.1.0 Preview public API.

Thread Safety

Instances of this type are not synchronized. Access them from the thread that owns the object unless the member documentation states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

Members

Member Kind Summary
E Field Represents the e value.
Epsilon Field Represents the epsilon value.
Pi Field Represents the pi value.
Tau Field Represents the tau value.
CeilToInt(System.Single) Method Executes the ceil to int operation.
Clamp(System.Int32, System.Int32, System.Int32) Method Executes the clamp operation.
Clamp(System.Single, System.Single, System.Single) Method Executes the clamp operation.
DegToRad(System.Single) Method Executes the deg to rad operation.
FloorToInt(System.Single) Method Executes the floor to int operation.
InverseLerp(System.Single, System.Single, System.Single) Method Executes the inverse lerp operation.
IsEqualApprox(System.Single, System.Single) Method Checks whether equal approx is true.
IsFinite(System.Single) Method Checks whether finite is true.
IsZeroApprox(System.Single) Method Checks whether zero approx is true.
Lerp(System.Single, System.Single, System.Single) Method Executes the lerp operation.
MoveToward(System.Single, System.Single, System.Single) Method Executes the move toward operation.
PosMod(System.Int32, System.Int32) Method Executes the pos mod operation.
PosMod(System.Single, System.Single) Method Executes the pos mod operation.
RadToDeg(System.Single) Method Executes the rad to deg operation.
RoundToInt(System.Single) Method Executes the round to int operation.
Snapped(System.Single, System.Single) Method Executes the snapped operation.

Member Details

E

Kind: Field

public const System.Single E

Summary

Represents the e value.

Remarks

Use this field as a stable value supplied by the declaring type.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Mathf

Epsilon

Kind: Field

public const System.Single Epsilon

Summary

Represents the epsilon value.

Remarks

Use this field as a stable value supplied by the declaring type.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Mathf

Pi

Kind: Field

public const System.Single Pi

Summary

Represents the pi value.

Remarks

Use this field as a stable value supplied by the declaring type.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Mathf

Tau

Kind: Field

public const System.Single Tau

Summary

Represents the tau value.

Remarks

Use this field as a stable value supplied by the declaring type.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Mathf

CeilToInt(System.Single)

Kind: Method

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

Summary

Executes the ceil to int operation.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Parameters

  • value: The value to use.

Returns

The result of the operation.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Mathf

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

Kind: Method

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

Summary

Executes the clamp operation.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Parameters

  • value: The value to use.
  • min: The min value.
  • max: The max value.

Returns

The result of the operation.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Mathf

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

Kind: Method

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

Summary

Executes the clamp operation.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Parameters

  • value: The value to use.
  • min: The min value.
  • max: The max value.

Returns

The result of the operation.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Mathf

DegToRad(System.Single)

Kind: Method

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

Summary

Executes the deg to rad operation.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Parameters

  • degrees: The degrees value.

Returns

The result of the operation.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Mathf

FloorToInt(System.Single)

Kind: Method

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

Summary

Executes the floor to int operation.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Parameters

  • value: The value to use.

Returns

The result of the operation.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Mathf

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

Kind: Method

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

Summary

Executes the inverse lerp operation.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Parameters

  • from: The from value.
  • to: The to value.
  • weight: The weight value.

Returns

The result of the operation.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Mathf

IsEqualApprox(System.Single, System.Single)

Kind: Method

public static System.Boolean IsEqualApprox(System.Single, System.Single)(System.Single a, System.Single b)

Summary

Checks whether equal approx is true.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Parameters

  • a: The a value.
  • b: The b value.

Returns

true when the condition is met; otherwise, false.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Mathf

IsFinite(System.Single)

Kind: Method

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

Summary

Checks whether finite is true.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Parameters

  • value: The value to use.

Returns

true when the condition is met; otherwise, false.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Mathf

IsZeroApprox(System.Single)

Kind: Method

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

Summary

Checks whether zero approx is true.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Parameters

  • value: The value to use.

Returns

true when the condition is met; otherwise, false.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Mathf

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

Kind: Method

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

Summary

Executes the lerp operation.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Parameters

  • from: The from value.
  • to: The to value.
  • weight: The weight value.

Returns

The result of the operation.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Mathf

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

Kind: Method

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

Summary

Executes the move toward operation.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Parameters

  • from: The from value.
  • to: The to value.
  • delta: The elapsed time in seconds.

Returns

The result of the operation.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Mathf

PosMod(System.Int32, System.Int32)

Kind: Method

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

Summary

Executes the pos mod operation.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Parameters

  • value: The value to use.
  • modulo: The modulo value.

Returns

The result of the operation.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Mathf

PosMod(System.Single, System.Single)

Kind: Method

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

Summary

Executes the pos mod operation.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Parameters

  • value: The value to use.
  • modulo: The modulo value.

Returns

The result of the operation.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Mathf

RadToDeg(System.Single)

Kind: Method

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

Summary

Executes the rad to deg operation.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Parameters

  • radians: The radians value.

Returns

The result of the operation.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Mathf

RoundToInt(System.Single)

Kind: Method

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

Summary

Executes the round to int operation.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Parameters

  • value: The value to use.

Returns

The result of the operation.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Mathf

Snapped(System.Single, System.Single)

Kind: Method

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

Summary

Executes the snapped operation.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Parameters

  • value: The value to use.
  • step: The step value.

Returns

The result of the operation.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Mathf

Clone this wiki locally