Skip to content

math

This table contains additional math functions.

moonlight.math.normalize

Parameters

  • number x
  • number y
  • number z

Returns

  • number
  • number
  • number

moonlight.math.clamp

Parameters

  • number x
  • number y
  • number z

Returns

  • number

Remarks

  • https://en.wikipedia.org/wiki/Clamping_(graphics)

moonlight.math.vector_length

Parameters

  • number x
  • number y
  • number z

Returns

  • number

moonlight.math.vector_distance_sqr

Parameters

  • number x
  • number y
  • number z

Returns

  • number

moonlight.math.vector_distance

Parameters

  • number x
  • number y
  • number z

Returns

  • number

moonlight.math.angle_between

Parameters

  • number x
  • number y
  • number z
  • number x2
  • number y2
  • number z2

Returns

  • number
  • number
  • number

moonlight.math.angle

Remarks

  • This is a mirror function of moonlight.game.angle.