Skip to content
sanya_fritz edited this page Mar 23, 2024 · 1 revision

Documentation for the math library

This library provides various mathematical functions for performing computations.

Constants

  • PI: Represents the mathematical constant pi (π), approximately equal to 3.14159265358979323846.

Functions

  • factorial(int n): Computes the factorial of the given integer n.

    • Returns: The value of the factorial as an integer.
  • power(double base, int exponent): Computes the power of a number.

    • Parameters:
      • base: The base of the number.
      • exponent: The exponent.
    • Returns: The result of raising base to the power of exponent as a floating-point number.
  • sin(double x): Computes the sine of the given angle in radians.

    • Parameter:
      • x: The angle in radians.
    • Returns: The sine of the angle as a floating-point number.
  • cos(double x): Computes the cosine of the given angle in radians.

    • Parameter:
      • x: The angle in radians.
    • Returns: The cosine of the angle as a floating-point number.
  • tan(double x): Computes the tangent of the given angle in radians.

    • Parameter:
      • x: The angle in radians.
    • Returns: The tangent of the angle as a floating-point number.
  • ctan(double x): Computes the cotangent of the given angle in radians.

    • Parameter:
      • x: The angle in radians.
    • Returns: The cotangent of the angle as a floating-point number.
  • log(double x): Computes the natural logarithm (base e) of the given number.

    • Parameter:
      • x: The number.
    • Returns: The natural logarithm of the number as a floating-point number.
  • radians(double angle): Converts the given angle from degrees to radians.

    • Parameter:
      • angle: The angle in degrees.
    • Returns: The angle converted to radians as a floating-point number.

Clone this wiki locally