bevy_math

Module ops

Source
Expand description

This mod re-exports the correct versions of floating-point operations with unspecified precision in the standard library depending on whether the libm crate feature is enabled.

All the functions here are named according to their versions in the standard library.

Traits§

  • This extension trait covers shortfall in determinacy from the lack of a libm counterpart to f32::powi. Use this for the common small exponents.

Functions§

  • acosNon-libm
    Computes the arccosine of a number. Return value is in radians in the range [0, pi] or NaN if the number is outside the range [-1, 1].
  • acoshNon-libm
    Inverse hyperbolic cosine function.
  • asinNon-libm
    Computes the arcsine of a number. Return value is in radians in the range [-pi/2, pi/2] or NaN if the number is outside the range [-1, 1].
  • asinhNon-libm
    Inverse hyperbolic sine function.
  • atanNon-libm
    Computes the arctangent of a number. Return value is in radians in the range [-pi/2, pi/2];
  • atan2Non-libm
    Computes the four quadrant arctangent of self (y) and other (x) in radians.
  • atanhNon-libm
    Inverse hyperbolic tangent function.
  • cbrtNon-libm
    Returns the cube root of a number.
  • cosNon-libm
    Computes the cosine of a number (in radians).
  • coshNon-libm
    Hyperbolic cosine function.
  • expNon-libm
    Returns e^(self), (the exponential function).
  • exp2Non-libm
    Returns 2^(self).
  • exp_m1Non-libm
    Returns e^(self) - 1 in a way that is accurate even if the number is close to zero.
  • hypotNon-libm
    Compute the distance between the origin and a point (x, y) on the Euclidean plane. Equivalently, compute the length of the hypotenuse of a right-angle triangle with other sides having length x.abs() and y.abs().
  • lnNon-libm
    Returns the natural logarithm of the number.
  • ln_1pNon-libm
    Returns ln(1+n) (natural logarithm) more accurately than if the operations were performed separately.
  • log2Non-libm
    Returns the base 2 logarithm of the number.
  • log10Non-libm
    Returns the base 10 logarithm of the number.
  • powfNon-libm
    Raises a number to a floating point power.
  • sinNon-libm
    Computes the sine of a number (in radians).
  • sin_cosNon-libm
    Simultaneously computes the sine and cosine of the number, x. Returns (sin(x), cos(x)).
  • sinhNon-libm
    Hyperbolic sine function.
  • tanNon-libm
    Computes the tangent of a number (in radians).
  • tanhNon-libm
    Hyperbolic tangent function.