Math.Cos(Value)
.Cos() method returns the cosine of the specified angle (in radians).
Applies To
Math
Properties and Methods
None
Available
The .Cos(Value) method is available in:
- 15.03.016
- All newer builds
Type
Decimal
Syntax
Math.Cos(Value);
Parameters
|
Parameter |
Required |
Description |
|---|---|---|
|
Value |
Yes |
A number representing an angle in radians. |
Example
//--Converts the Cosine of -.5 to radians using .Acos method. Then pass that number into the .Cos method to return the cosine value.
var lnACos = Math.Acos(-.5)
var lcMath = 'lnACos = Math.Acos(-.5): ' + Convert.ToString(Math.Acos(-.5)) + '\n';
lcMath += 'Math.Cos(lnACos): ' + Convert.ToString(Math.Cos(lnACos)) + '\n';
Event.Form.MessageBox(lcMath);
/* Expected Prompt Result:
lnACos = Math.Acos(-.5): 2.0943951023932
Math.Cos(lnACos): -0.500000000000004
*/