Library math

To use this library in your code:

import math
Mathematical functions and constants.

Classes

A 3D point with coordinates represented as floats.

Globals

E
Euler's number.
The base of the natural logarithm.

Natural logarithm of 10.

Natural logarithm of 2.

Base-10 logarithm of E.

Base-2 logarithm of E.

Pi.
The ratio of a circle's circumference to its diameter.

Square root of 1/2.

Square root of 2.

Functions

Returns (in radians) the arccosine of the given x.

Returns (in radians) the arcsine of the given x.

Returns the arctangent of the given x.
The result (in radians) will be in the range -pi/2 to pi/2 and have the same sign as x.

Returns the two argument arctangent of x and y.

cos angle/num -> float
Returns the cosine of the angle in radians.

Returns the hyperbolic cosine of the hyperbolic angle x.

Returns the exponential of the given x, i.e. Euler's number to the power of x.

Returns the natural logarithm of the given x.
For negative x, NaN (float.NAN) is returned.

log x/num n/num -> float
Returns, approximately, the n base logarithm of the given x.
For negative x or n, NaN (float.NAN) is returned.

pow x/num y/num -> float
Returns x to the power of y.

sin angle/num -> float
Returns the sine of the angle in radians.

Returns the hyperbolic sine of the hyperbolic angle x.

Returns the square root of the given x.
For negative x, NaN (float.NAN) is returned.

tan angle/num -> float
Returns the tangent of the angle in radians.

Returns the hyperbolic tangent of the hyperbolic angle x.