Contents > Library Reference > Math

Math

Trigonometric and other mathematical functions. All trigonometry functions operate in radians. The device must have MathLib installed to use most of these functions.

Functions

| float cos(float f) | Returns the cosine of value
| float sin(float f) | Returns the sine of value
| float tan(float f) | Returns the tangent of value
| float acos(float f) | Returns the arccosine of value
| float asin(float f) | Returns the arcsine of value
| float atan(float f) | Returns the arctangent of value
| float cosh(float f) | Returns the hyperbolic cosine of value
| float sinh(float f) | Returns the hyperbolic sine of value
| float tanh(float f) | Returns the hyperbolic tangent of value
| float acosh(float f) | Returns the hyperbolic arccosine of value
| float asinh(float f) | Returns the hyperbolic arcsine of value
| float atanh(float f) | Returns the hyperbolic arctangent of value
| float exp(float f) | Returns the exponential of value.
| float log(float f) | Returns the logarithm of value.
| float log10(float f) | Returns the base-10 logarithm of value.
| float sqrt(float f) | Returns the square root of value.
| float atan2(float x, float y) | Returns the arctangent of x/y.
| float pow(float x, float y) | Returns x to the power of y.
| int random(int max) | Return a random integer between 0 and n-1.
| float rand() | Returns a random float between 0 and 1.
| int srand() | Seeds the random number generator.

Contents > Library Reference > Math > cos

cos

`float cos(float f)`

Parameters:

| f | value

Return value: cosine result

Returns the cosine of value

Contents > Library Reference > Math > sin

sin

`float sin(float f)`

Parameters:

| f | value

Return value: sine result

Returns the sine of value

Contents > Library Reference > Math > tan

tan

`float tan(float f)`

Parameters:

| f | value

Return value: tangent result

Returns the tangent of value

Contents > Library Reference > Math > acos

acos

`float acos(float f)`

Parameters:

| f | value

Return value: arccosine result

Returns the arccosine of value

Contents > Library Reference > Math > asin

asin

`float asin(float f)`

Parameters:

| f | value

Return value: arcsine result

Returns the arcsine of value

Contents > Library Reference > Math > atan

atan

`float atan(float f)`

Parameters:

| f | value

Return value: arctangent result

Returns the arctangent of value

Contents > Library Reference > Math > cosh

cosh

`float cosh(float f)`

Parameters:

| f | value

Return value: hyperbolic cosine result

Returns the hyperbolic cosine of value

Contents > Library Reference > Math > sinh

sinh

`float sinh(float f)`

Parameters:

| f | value

Return value: hyperbolic sine result

Returns the hyperbolic sine of value

Contents > Library Reference > Math > tanh

tanh

`float tanh(float f)`

Parameters:

| f | value

Return value: hyperbolic tangent result

Returns the hyperbolic tangent of value

Contents > Library Reference > Math > acosh

acosh

`float acosh(float f)`

Parameters:

| f | value

Return value: hyperbolic arccosine result

Returns the hyperbolic arccosine of value

Contents > Library Reference > Math > asinh

asinh

`float asinh(float f)`

Parameters:

| f | value

Return value: hyperbolic arcsine result

Returns the hyperbolic arcsine of value

Contents > Library Reference > Math > atanh

atanh

`float atanh(float f)`

Parameters:

| f | value

Return value: hyperbolic arctangent result

Returns the hyperbolic arctangent of value

Contents > Library Reference > Math > exp

exp

`float exp(float f)`

Parameters:

| f | value

Return value: exponential result

Returns the exponential of value.

Contents > Library Reference > Math > log

log

`float log(float f)`

Parameters:

| f | value

Return value: logarithm result

Returns the logarithm of value.

Contents > Library Reference > Math > log10

log10

`float log10(float f)`

Parameters:

| f | value

Return value: base-10 logarithm result

Returns the base-10 logarithm of value.

Contents > Library Reference > Math > sqrt

sqrt

`float sqrt(float f)`

Parameters:

| f | value

Return value: square root

Returns the square root of value.

Contents > Library Reference > Math > atan2

atan2

`float atan2(float x, float y)`

Parameters:

| x | x value
| y | y value

Return value: arctangent result

Returns the arctangent of x/y.

Contents > Library Reference > Math > pow

pow

`float pow(float x, float y)`

Parameters:

| x | x value
| y | y value

Return value: power result

Returns x to the power of y.

Contents > Library Reference > Math > random

random

`int random(int max)`

Parameters:

| max | maximum

Return value: random result

Return a random integer between 0 and n-1.

Contents > Library Reference > Math > rand

rand

`float rand()`

Return value: random result

Returns a random float between 0 and 1.

Contents > Library Reference > Math > srand

srand

`int srand()`

Seeds the random number generator.