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.
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.
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.