Trigonometry Library - mikroElektronika PIC Microcontrollers PIC12 User Manual

Mikroc user's manual
Table of Contents

Advertisement

mikroC
making it simple...

Trigonometry Library

mikroC implements fundamental trigonometry functions. These functions are
implemented as lookup tables, and return the result as integer, multiplied by 1000
and rounded up.
Library Routines
SinE3
CosE3
SinE3
Prototype
int SinE3(unsigned angle_deg);
Returns
Function returns the sine of input parameter, multiplied by 1000 (1E3) and rounded up
to the nearest integer. The range of return values is from -1000 to 1000.
Description
Function takes parameter
sine multiplied by 1000 and rounded up to the nearest integer. The function is imple-
mented as a lookup table; maximum error obtained is ±1.
Example
res = SinE3(45);
CosE3
Prototype
int CosE3(unsigned angle_deg);
Returns
Function returns the cosine of input parameter, multiplied by 1000 (1E3) and rounded
up to the nearest integer. The range of return values is from -1000 to 1000.
Description
Function takes parameter
cosine multiplied by 1000 and rounded up to the nearest integer. The function is imple-
mented as a lookup table; maximum error obtained is ±1.
Example
res = CosE3(196);
MikroElektronika: Development tools - Books - Compilers
mikroC - C Compiler for Microchip PIC microcontrollers
which represents angle in degrees, and returns its
angle_deg
// result is 707
which represents angle in degrees, and returns its
angle_deg
// result is -193
page
303

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the PIC Microcontrollers PIC12 and is the answer not in the manual?

This manual is also suitable for:

Pic microcontrollers pic16Pic microcontrollers pic18

Table of Contents