The Cos function returns the value corresponding to the cosine of the passed value.
Syntax | ||||
Cos(Value) | ||||
Return value | ||||
Type |
Description | |||
Double |
Cosine of value | |||
Parameter | ||||
Use |
Name |
Type |
Passing |
Description |
Required |
Value |
Double |
ByVal |
Value to retrieve the cosine. |
Notes
The Cos function calculates the ratio of two sides in a right-angled triangle from an angle. The ratio is the length of the side attached to the angle divided by the length of the hypotenuse.
The result ranges from -1 to 1.
In order to convert degrees to radians, the degree must be multiplied by π/180.
Example
Dim Angle As
Double, Secans As Double
Angle :=
1.3
# define angle in radiant
Secans := 1 /
Cos(Angle)
# calc the Secans
In this example, the Cos function is used to return the secans of an angle.