User Manual
MCP Series
Brushed DC Motor Controllers
MCP Series User Manual
144
FSIN
The FSIN operator calculates the oating point Sine of an angle in radians. FSIN gives the ratio
of the length of the side opposite of the angle to the length of the hypotenuse in a right triangle.
myangle var oat
mysin var oat
myangle = 3.14159/2.0 ;myangle now equals PI/2 degrees in radians
mysin = FSIN myangle ;mysin now equals 1.0
serout s_out,i9600,[“mysin = “,real mysin,13]
FCOS
The FCOS operator calculates the oating point cosine of an angle in radians. FCOS gives the
ratio of the length of the side adjacent the angle, to the length of the hypotenuse in a right
triangle.
myangle var oat
mycos var oat
myangle = 0.0 ;myangle now equals 0 degrees in radians
mycos = FCOS myangle ;mycos now equals 1.0
serout s_out,i9600,[“mycos = “,real mycos,13]
FTAN
The FTAN operator calculates the oating point tangent of an angle in radians. FTAN gives the
ratio of the length of the side opposite the angle to the length of the side adjacent to the angle in
a right triangle
myangle fcon 3.14159/4 ;myangle is 45 degrees in radians
myadj fcon 100.0
myopp var oat
;This calcualtion nds the triangles opposite side length
;for a right triangle with angle of 45 degrees and
;adjacent side of 100.
myopp = FTAN myangle * myadj ;myopp now equals 100.0
serout s_out,i9600,[“myopp = “,real myopp,13]
FASIN
The FASIN operator calculates the oating point arc sine of a value. FASIN returns the angle
in radians given the ratio of the length of the side opposite the angle and the length of the
hypotenuse in a right triangle.
mysin fcon 1.0
myangle var oat
myangle = FASIN mysin ;myoat equals PI/2
serout s_out,i9600,[“myangle = “,real myangle,13]