Mikroelektronika MIKROE-724 データシート

ページ / 726
mikroBasic PRO for dsPIC30/33 and PIC24
MikroElektronika
687
atan
Prototype
sub function atan(dim arg as float) as float
Description Function computes the arc tangent of parameter 
f
; that is, the value whose tangent is 
f
. The return value 
is in radians, between -Π/2 and Π/2 (inclusive).
Example
res = atan(1.0)  ‘ res = 7.853982e-1
atan2
Prototype
sub function atan2(dim y as float, dim x as float) as float
Description This is the two-argument arc tangent function. It is similar to computing the arc tangent of 
y/x
, except 
that the signs of both arguments are used to determine the quadrant of the result and 
x
 is permitted to 
be zero. The return value is in radians, between -Π and Π (inclusive).
Example
res = atan2(2., 1.)  ‘ res = 4.636475e-1
ceil
Prototype
sub function ceil(dim x as float) as float
Description Function returns value of parameter 
x
 rounded up to the next whole number.
Example
res = ceil(0.5)  ‘ res = 1.000000
cos
Prototype
sub function cos(dim arg as float) as float
Description Function returns the cosine of 
f
 in radians. The return value is from -1 to 1.
Example
res = cos(PI/3.)  ‘ res = 0.500008
cosh
Prototype
sub function cosh(dim x as float) as float
Description Function returns the hyperbolic cosine of 
x
, defined mathematically as 
(e
x
+e
-x
)/2
. If the value of 
x
 is 
too large (if overflow occurs), the function fails.
Example
res = cosh(PI/3.)  ‘ res = 1.600286
eval_poly
Prototype
sub function eval_poly(dim x as float, dim byref d as array[10] of float, dim 
n as integer) as float
Description Function Calculates polynom for number 
x
, with coefficients stored in 
d[]
, for degree 
n
.