Returns the cosine of a numeric expression.
COS(nExpression) |
Parameters
- nExpression
-
Specifies a numeric expression whose cosine COS( ) returns. nExpression can be any value.
Return Value
Numeric
Remarks
COS( ) returns the cosine of nExpression in radians. Use DTOR( ) to convert an angle from degrees to radians. The number of decimal places that COS( ) returns can be specified with SET DECIMALS. The value COS( ) returns ranges between –1 and 1.
Example
Copy Code | |
|---|---|
CLEAR ? COS(0) && Displays 1.00 ? COS(PI( )) && Displays -1.00 ? COS(DTOR(180)) && Displays -1.00 STORE PI( ) * 3 TO gnAngle ? COS(gnAngle) && Displays -1.00 | |

Microsoft Visual FoxPro 9 SP2 Help file, VFPX Edition v1.08