ooPIC Logo

Cos Function

Main Index
Language Idx
Back to top of pageDescription:
 
The Cos function calculates and returns the cosine of an angle.  It takes an argument of a numeric data type representing an angle and returns the argument's trigonometric Cosine value in binary radians.
Back to top of pageSyntax:
 
The following shows the format of the Cos function syntax.
Cos({expression})
 
The following table lists the elements of the Cos function syntax.
ElementDescription
{expression}Any valid numeric expression that expresses an angle.
Back to top of pageOperation:
 
When a Cos function is encountered during the program's execution, it takes the {expression} element which is expressed in Binary Radians, calculates and then returns the trigonometric ratio of two sides of a right triangle. The calculated ratio is the length of the side adjacent to the angle divided by the length of the hypotenuse.
Back to top of pageRemarks:
 

Cosine is defined as the ratio created by dividing the length of the side adjacent to the angle (X) by the length of the hypotenuse (H).

The result of the Cos function is a numeric type expressed as an 8-Bit integer.  The 8-Bit integer is represented by the number which when divided by 255 forms the ratio equivalent to the angle being represented. In other words, a result of 45 from a Cos call represents the angle 45/255.

Back to top of pageExample:
 The following are simple uses for the Abs function.
Visual Basic Syntax C and Java Syntax
A = Cos(90)
A = Cos(90);
Basic Syntax 
A = Cos(90)
 

Back to top of pageRelated Items:

 Sin Statement, oConverter Object.
Back to top of pageVersion History and Bug List:
 Firmware Ver A1: Introduced.

Bugs: No known bugs.


 

ooPIC Compiler Ver 6.0 (c) Copyright 1997 - 2007 Savage Innovations, LLC.