Module firefly_rust::math

source ·
Expand description

A few useful math (trigonometric) functions for f32.

Use micromath and nalgebra if you need more.

Functions§

  • Returns the absolute value of a number.
  • Approximates atan(x) approximation in radians with a maximum error of 0.002.
  • Approximates atan(x) normalized to the [−1,1] range with a maximum error of 0.1620 degrees.
  • Approximates cos(x) in radians with a maximum error of 0.002.
  • Returns the largest integer less than or equal to a number.
  • Approximates sin(x) in radians with a maximum error of 0.002.
  • Approximates the square root of a number with an average deviation of ~5%.
  • Approximates tan(x) in radians with a maximum error of 0.6.