ooPIC Logo

Sin Function

Main Index
Language Idx
Back to top of pageDescription:
 
The Sin function (pronounced "Sine Function") is a function that takes an argument of a numeric data type that represents an angle and returns the argument's trigonometric Sine value.
Back to top of pageSyntax:
 
The following shows the format of the Sin Function syntax.
 
Sin({expression})
 
The following table lists the elements of the Sin Function syntax.
 
ElementDescription
{expression}Any valid numeric expression that expresses an angle.
Back to top of pageOperation:
 
When a Sin function is encountered during the program's execution, it takes the {expression} element which is expressed in an 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 opposite the angle divided by the length of the hypotenuse.
Back to top of pageRemarks:
 
Sine is defined as the ration created by dividing the length of the side opposite the angle (Y) by the length of the hypotenuse (H) in a right triangle.

The Sin function returns a numeric data type.

The result of the Sin function is the value represented by the number which divided by 255 forms the ratio equivilent to the angle being represented. In other words, a result of 45 from a Sin call represents the angle 45/255. This is how the ooPIC gets around the integer math limitation.

The oConverter Object also provides this function.

Back to top of pageExample:
 
 In this example, the variable A is assigned to the Sine value for 90.
A = Sin(90)

Back to top of pageRelated Items:

 Cos function, oConverter Object, URCP Heading Value.
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.