Mikroelektronika MIKROE-350 Fiche De Données

Page de 526
TRIGONOMETRY LIBRARY
The mikroBasic PRO for AVR implements fundamental trigonometry functions. These functions
are implemented as look-up tables. Trigonometry functions are implemented in integer format in
order to save memory.
Library Routines
- sinE3 
- cosE3 
sinE3
498
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroBasic PRO for AVR
CHAPTER 6
Prototype
sub function sinE3(dim angle_deg as wordas integer
Returns
The function returns the sine of input parameter.
Description
The function calculates sine multiplied by 1000 and rounded to the nearest integer:
result = round(sin(angle_deg)*1000)
Parameters: 
angle_deg:
input angle in degrees 
Note: Return value range: -1000..1000.
Requires
Nothing.
Example
dim res as integer
...
res = sinE3(45)  ' result is 707