User Manual

MCP Series
Brushed DC Motor Controllers
MCP Series User Manual
145
FACOS
The FACOS operator calculates the oating point arc cosine of a value. FACOS returns the angle
in radians given the ratio of the length of the side adjacent the angle and the length of the
hypotenuse in a right triangle.
mycos fcon 0.0
myangle var oat
myangle = FACOS mycos ;myoat equals 0
serout s_out,i9600,[“myangle = “,real myangle,13]
FATAN
The FATAN operator calculates the oating point arc tangent of a value. FATAN returns the angle
in radians given the ratio of the length of the side opposite the angle and the length of the side
adjacent to the angle in a right triangle.
mytan fcon 1.0
myangle var oat
myangle = FATAN mytan ; myoat equals PI/4
serout s_out,i9600,[“myangle = “,real myangle,13]
FLN
The FLN operator calculates the oating point natural log of a value. The natural log is used to
calculate the time it takes for compound growth to reach the specied amount. For example
FLN 20.08 will equal approximately 3. This means it takes 3 growth cycles (the amount of time it
takes to grow 100%) to reach 20.08 times the original amount.
result var oat
result = FLN 2.0 ;result now equals 0.69315
serout s_out,i9600,[“result = “,real result,13]
FEXP
The FEXP operator calculates the Floating Point Natural Exponent of a value. The natural
exponent calculates the inverse of the natural log. Given time how much will something grow.
FEXP 3 will equal approximately 20.08 times the original quantity.
result var oat
result = FEXP 0.693115 ;result now equals 2.0
serout s_out,i9600,[“result = “,real result,13]