COS
From MCS Wiki AVR
(Difference between revisions)
(One intermediate revision by one user not shown) | |||
Line 9: | Line 9: | ||
= <span class="f_Header">Syntax</span> = | = <span class="f_Header">Syntax</span> = | ||
− | var = <span class="f_Syntax">COS</span>( | + | var = <span class="f_Syntax">COS</span>( float ) |
<span style="font-family: Arial;"> </span> | <span style="font-family: Arial;"> </span> | ||
Line 23: | Line 23: | ||
| valign="top" width="100%" style="width: 453px; border: 1px solid rgb(0, 0, 0);" | | | valign="top" width="100%" style="width: 453px; border: 1px solid rgb(0, 0, 0);" | | ||
− | A numeric variable that is assigned with cosine of variable | + | A numeric variable that is assigned with cosine of variable float. |
|- style="vertical-align: top;" | |- style="vertical-align: top;" | ||
| valign="top" width="15%" style="width: 77px; border: 1px solid rgb(0, 0, 0);" | | | valign="top" width="15%" style="width: 77px; border: 1px solid rgb(0, 0, 0);" | | ||
− | + | Float | |
| valign="top" width="100%" style="width: 453px; border: 1px solid rgb(0, 0, 0);" | | | valign="top" width="100%" style="width: 453px; border: 1px solid rgb(0, 0, 0);" | | ||
− | The | + | The float variable to get the cosine of. |
|} | |} |
Latest revision as of 20:38, 15 June 2015
Contents |
Action
Returns the cosine of a floating variable
Syntax
var = COS( float )
Remarks
Var |
A numeric variable that is assigned with cosine of variable float. |
Float |
The float variable to get the cosine of. |
All trig functions work with radians. Use deg2rad and rad2deg to convert between radians and angles.
See Also
RAD2DEG , DEG2RAD , ATN , SIN , TAN
Example
$regfile = "m48def.dat" ' specify the used micro $crystal = 8000000 ' used crystal frequency $baud = 19200 ' use baud rate $hwstack = 32 ' default use 32 for the hardware stack $swstack = 10 ' default use 10 for the SW stack $framesize = 40 ' default use 40 for the frame space Config Com1 = Dummy , Synchrone = 0 , Parity = None , Stopbits = 1 , Databits = 8 , Clockpol = 0 Dim S As Single , X As Single S = 0.5 : X = Tan(s) : Print X ' prints 0.546302195 S = 0.5 : X = Sin(s) : Print X ' prints 0.479419108 S = 0.5 : X = Cos(s) : Print X ' prints 0.877588389 End
Languages | English • Deutsch |
---|