Math library¶
Introduction¶
As in Python, the math library is here to provide the basic utils and maths functions so you can make some mathematics using dromadaire.
You can import this library using :
> import math
##or
> from math import *
## (will come soon)
Variables¶
The math library doesn’t have a lot of variables yet, but there will be a lot more in some days.
Functions¶
Trigonometry¶
cosinus
You can get the cosinus of an angle (in radians) using :
> math.cos(angle)
sinus
You can get the sinus of an angle (in radians) using :
> math.sin(angle)
tangent
You can get the tangent of an angle (in radians) using :
> math.tan(angle)
radians
You can convert an angle from degrees to radians using :
> math.radians(angle)
Arc cosinus
You can get the arc cosinus (in radians) of a cosinus using :
> math.acos(angle)
Arc sinus
You can get the arc sinus (in radians) of a sinus using :
> math.asin(angle)
Arc tangent
You can get the arc tangent (in radians) of a tangent using :
> math.atan(angle)
Hyperbolic trigonometry¶
Hyperbolic cosinus
You can get the hyperbolic cosinus of an angle (in radians) using :
> math.cosh(angle)
Hyperbolic sinus
You can get the hyperbolic sinus of an angle (in radians) using :
> math.sinh(angle)
Hyperbolic tangent
You can get the hyperbolic tangent of an angle (in radians) using :
> math.tanh(angle)
Hyperbolic Arc cosinus
You can get the hyperbolic arc cosinus (in radians) of an hyperbolic cosinus using :
> math.acosh(angle)
Hyperbolic Arc sinus
You can get the hyperbolic arc sinus (in radians) of an hyperbolic sinus using :
> math.asinh(angle)
Hyperbolic Arc tangent
You can get the hyperbolic arc tangent (in radians) of an hyperbolic tangent using :
> math.atanh(angle)
Other arithmetical functions¶
Absolute value
You can get the absolute value of a number using :
> math.abs(number)
Decimal logarithm
You can get the decimal logarithm of a number using :
> math.log(number)
Natural logarithm
You can get the natural logarithm of a number using :
> math.abs(number)
Exponential
You can get the exponential of a number using :
> math.exp(number)
Square root
You can get the square root of a number using :
> math.sqrt(number)
Factorial
You can get the factorial of a number using :
> math.fac(number)
Root
You can get the xth root of a number using :
> math.root(number,x)