-
Notifications
You must be signed in to change notification settings - Fork 0
Math
sanya_fritz edited this page Mar 23, 2024
·
1 revision
This library provides various mathematical functions for performing computations.
-
PI: Represents the mathematical constant pi (π), approximately equal to 3.14159265358979323846.
-
factorial(int n): Computes the factorial of the given integern.- 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
baseto the power ofexponentas a floating-point number.
- Parameters:
-
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.
- Parameter:
-
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.
- Parameter:
-
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.
- Parameter:
-
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.
- Parameter:
-
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.
- Parameter:
-
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.
- Parameter: