VEX IQ Python API
|
PyMite's math module, using Python 2.6 math library as a reference https://docs.python.org/2.6/library/math.html. More...
Functions | |
def | is_prime (n) |
Number theoretic and representation functions | |
def | ceil (x) |
Return the ceiling of x as a float, the smallest integer value greater than or equal to x. More... | |
def | copysign (x, y) |
Return x with the sign of y. More... | |
def | fabs (x) |
Return the absolute value of x. More... | |
def | factorial (x) |
Return x factorial. More... | |
def | floor (x) |
Return the floor of x as a float, the largest integer value less than or equal to x. More... | |
def | fmod (x, y) |
Returns the modulus (remainder) of x divided by y. More... | |
def | frexp (x) |
Return the mantissa and exponent of x as the pair (m, e). More... | |
def | fsum (list) |
Return a floating point sum of items in the list/tuple. More... | |
def | isinf (x) |
Check if the float x is positive or negative infinity. More... | |
def | isnan (x) |
Check if the float x is a NaN (not a number). More... | |
def | ldexp (x, exp) |
Return x * (2**exp). More... | |
def | modf (x) |
Return the fractional and integer parts of x. More... | |
def | trunc (x) |
Return the nearest integral value that is not larger in magnitude than x. More... | |
Trigonometric functions | |
def | acos (x) |
Return the arc cosine of x, in radians. More... | |
def | asin (x) |
Return the arc sine of x, in radians. More... | |
def | atan (x) |
Return the arc tangent of x, in radians. More... | |
def | atan2 (y, x) |
Return atan(y / x), in radians. More... | |
def | cos (x) |
Return the cosine of x radians. More... | |
def | hypot (x, y) |
Return the Euclidean norm, sqrt(x*x + y*y). More... | |
def | sin (x) |
Return the sine of x radians. More... | |
def | tan (x) |
Return the tangent of x radians. More... | |
Angular conversion | |
def | degrees (x) |
Converts angle x from radians to degrees. More... | |
def | radians (x) |
Converts angle x from degrees to radians. More... | |
Power and logarithmic functions | |
float | pi = 3.1415926535897931 |
The mathematical constant PI = 3.141592..., to available precision. More... | |
float | e = 2.7182818284590451 |
The mathematical constant e = 2.718281..., to available precision. More... | |
def | exp (x) |
Return e**x. More... | |
def | log (x, base=None) |
With one argument, return the natural logarithm of x (to base e). More... | |
def | log1p (x) |
Return the natural logarithm of 1+x (base e). More... | |
def | log10 (x) |
Return the base-10 logarithm of x. More... | |
def | pow (x, y) |
Return x raised to the power y. More... | |
def | sqrt (x) |
Return the square root of x. More... | |
PyMite's math module, using Python 2.6 math library as a reference https://docs.python.org/2.6/library/math.html.
def math.ceil | ( | x | ) |
Return the ceiling of x as a float, the smallest integer value greater than or equal to x.
def math.copysign | ( | x, | |
y | |||
) |
Return x with the sign of y.
def math.fabs | ( | x | ) |
Return the absolute value of x.
def math.factorial | ( | x | ) |
Return x factorial.
Raises ValueError if x is negative.
def math.floor | ( | x | ) |
Return the floor of x as a float, the largest integer value less than or equal to x.
def math.fmod | ( | x, | |
y | |||
) |
Returns the modulus (remainder) of x divided by y.
def math.frexp | ( | x | ) |
Return the mantissa and exponent of x as the pair (m, e).
m is a float and e is an integer such that x == m * 2**e exactly. If x is zero, returns (0.0, 0), otherwise 0.5 <= abs(m) < 1. This is used to "pick apart" the internal representation of a float in a portable way.
def math.fsum | ( | list | ) |
Return a floating point sum of items in the list/tuple.
def math.isinf | ( | x | ) |
Check if the float x is positive or negative infinity.
def math.isnan | ( | x | ) |
Check if the float x is a NaN (not a number).
def math.ldexp | ( | x, | |
exp | |||
) |
Return x * (2**exp).
This is essentially the inverse of function frexp().
def math.modf | ( | x | ) |
Return the fractional and integer parts of x.
Both results carry the sign of x and are floats.
def math.trunc | ( | x | ) |
Return the nearest integral value that is not larger in magnitude than x.
def math.exp | ( | x | ) |
Return e**x.
def math.log | ( | x, | |
base = None |
|||
) |
With one argument, return the natural logarithm of x (to base e).
With two arguments, return the logarithm of x to the given base, calculated as log(x)/log(base)
def math.log1p | ( | x | ) |
Return the natural logarithm of 1+x (base e).
The result is calculated in a way which is accurate for x near zero.
def math.log10 | ( | x | ) |
Return the base-10 logarithm of x.
This is usually more accurate than log(x, 10)
def math.pow | ( | x, | |
y | |||
) |
Return x raised to the power y.
def math.sqrt | ( | x | ) |
Return the square root of x.
def math.acos | ( | x | ) |
Return the arc cosine of x, in radians.
def math.asin | ( | x | ) |
Return the arc sine of x, in radians.
def math.atan | ( | x | ) |
Return the arc tangent of x, in radians.
def math.atan2 | ( | y, | |
x | |||
) |
Return atan(y / x), in radians.
The result is between -pi and pi. The vector in the plane from the origin to point (x, y) makes this angle with the positive X axis. The point of atan2() is that the signs of both inputs are known to it, so it can compute the correct quadrant for the angle. For example, atan(1) and atan2(1, 1) are both pi/4, but atan2(-1, -1) is -3*pi/4.
def math.cos | ( | x | ) |
Return the cosine of x radians.
def math.hypot | ( | x, | |
y | |||
) |
Return the Euclidean norm, sqrt(x*x + y*y).
This is the length of the vector from the origin to point (x, y).
def math.sin | ( | x | ) |
Return the sine of x radians.
def math.tan | ( | x | ) |
Return the tangent of x radians.
def math.degrees | ( | x | ) |
Converts angle x from radians to degrees.
def math.radians | ( | x | ) |
Converts angle x from degrees to radians.
def math.is_prime | ( | n | ) |
float math.pi = 3.1415926535897931 |
The mathematical constant PI = 3.141592..., to available precision.
float math.e = 2.7182818284590451 |
The mathematical constant e = 2.718281..., to available precision.