Version: latest - a1.7.0 βοΈ

# NanosMath

A table containing useful and aux Math functions

##### info

Tip: This structure is Open Sourced at https://github.com/nanos-world/nanos-world-lua-lib. Feel free to push merge requests and suggest changes!

## Usageβ

``local axis = NanosMath.ClampAxis(720)``

## Static Functionsβ

ReturnsNameDescription
number`Round`Rounds a number
number`Clamp`
number`ClampAxis`Clamps an angle to the range of [0, 360]
number`NormalizeAxis`Clamps an angle to the range of [-180, 180]
number`FInterpTo`Interpolate number from Current to Target
Rotator`RInterpTo`Interpolate Rotator from Current to Target
Rotator`RInterpConstantTo`Interpolate Rotator from Current to Target with a constant step
Vector`VInterpTo`Interpolate Vector from Current to Target
Vector`VInterpConstantTo`Interpolate Vector from Current to Target with a constant step

### `Round`β

Rounds a number

``NanosMath.Round(value)``
TypeParameterDescription
number`value`

### `Clamp`β

Clamps a number

``NanosMath.Clamp(value, min, max)``
TypeParameterDescription
number`value`
number`min`
number`max`

### `ClampAxis`β

Clamps an angle to the range of [0, 360].

``NanosMath.ClampAxis(value)``
TypeParameterDescription
number`value`

### `NormalizeAxis`β

Clamps an angle to the range of [-180, 180].

``NanosMath.NormalizeAxis(value)``
TypeParameterDescription
number`value`

### `FInterpTo`β

Interpolate scalar from Current to Target

``NanosMath.FInterpTo(current, target, delta_time, interp_speed)``
TypeParameterDescription
number`current`
number`target`
number`delta_time`
number`interp_speed`

### `RInterpTo`β

Interpolate Rotator from Current to Target

``NanosMath.RInterpTo(current, target, delta_time, interp_speed)``
TypeParameterDescription
Rotator`current`
Rotator`target`
number`delta_time`
number`interp_speed`

### `RInterpConstantTo`β

Interpolate Rotator from Current to Target with a constant step

``NanosMath.RInterpConstantTo(current, target, delta_time, interp_speed)``
TypeParameterDescription
Rotator`current`
Rotator`target`
number`delta_time`
number`interp_speed`

### `VInterpTo`β

Interpolate Vector from Current to Target

``NanosMath.VInterpTo(current, target, delta_time, interp_speed)``
TypeParameterDescription
Vector`current`
Vector`target`
number`delta_time`
number`interp_speed`

### `VInterpConstantTo`β

Interpolate Vector from Current to Target with a constant step

``NanosMath.VInterpConstantTo(current, target, delta_time, interp_speed)``
TypeParameterDescription
Vector`current`
Vector`target`
number`delta_time`
number`interp_speed`