Libraries
bignum
binary
bitmap
ble
bytes
core
crypto
device
ec618
encoding
esp32
expect
fixed-point
flash
font
gpio
i2c
i2s
icons
io
line-wrap
log
math
monitor
net
pulse-counter
reader
reader-writer
rmt
serial
spi
statistics
system
tls
uart
uuid
writer
zlib
Library math
To use this library in your code:
import math
Mathematical functions and constants.
Classes
Point3f
A 3D point with coordinates represented as floats.
Globals
E
Euler's number.
The base of the natural logarithm.
LN10
Natural logarithm of 10.
LN2
Natural logarithm of 2.
LOG10E
Base-10 logarithm of
E
.
LOG2E
Base-2 logarithm of
E
.
PI
Pi.
The ratio of a circle's circumference to its diameter.
SQRT1-2
Square root of
1/2
.
SQRT2
Square root of 2.
Functions
acos
x/
num
->
float
Returns (in radians) the arccosine of the given
x
.
asin
x/
num
->
float
Returns (in radians) the arcsine of the given
x
.
atan
x/
num
->
float
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
.
atan2
x/
num
y/
num
->
float
Returns the two argument arctangent of
x
and
y
.
cos
angle/
num
->
float
Returns the cosine of the
angle
in radians.
cosh
x/
num
->
float
Returns the hyperbolic cosine of the hyperbolic angle
x
.
exp
x/
num
->
float
Returns the exponential of the given
x
, i.e. Euler's number to the power of
x
.
log
x/
num
->
float
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.
sinh
x/
num
->
float
Returns the hyperbolic sine of the hyperbolic angle
x
.
sqrt
x/
num
->
float
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.
tanh
x/
num
->
float
Returns the hyperbolic tangent of the hyperbolic angle
x
.