# Cos Function

āĻāĻāĻāĻŋ āĻā§āĻ¨ā§āĻ° āĻā§āĻ¸āĻžāĻāĻ¨ āĻāĻŖāĻ¨āĻž āĻāĻ°ā§ āĻĨāĻžāĻā§āĨ¤ āĻā§āĻ¨āĻāĻŋ āĻ°ā§āĻĄāĻŋā§āĻžāĻ¨ā§ āĻāĻ˛ā§āĻ˛ā§āĻ āĻāĻ°ā§ āĻĨāĻžāĻā§āĨ¤ āĻĢāĻ˛āĻžāĻĢāĻ˛ -1 āĻāĻŦāĻ 1 āĻāĻ° āĻŽāĻ§ā§āĻ¯ā§ āĻāĻāĻāĻŋ āĻŽāĻžāĻ¨ āĻšā§āĨ¤

Using the angle Alpha, the Cos function calculates the ratio of the length of the side that is adjacent to the angle, divided by the length of the hypotenuse in a right-angled triangle.

### Syntax:

``````
Cos (Number As Double) As Double
``````

Double

### Parameters:

āĻ¸āĻāĻā§āĻ¯āĻž: āĻ¸āĻāĻā§āĻ¯āĻžāĻ¸ā§āĻāĻ āĻāĻā§āĻ¸āĻĒā§āĻ°āĻļā§āĻļāĻ¨ āĻ¯āĻž āĻāĻāĻāĻŋ āĻā§āĻ¨ āĻ°ā§āĻĄāĻŋā§āĻžāĻ¨ā§ āĻāĻ˛ā§āĻ˛ā§āĻ āĻāĻ°ā§ āĻĨāĻžāĻā§ āĻāĻŦāĻ āĻ¯āĻžāĻ° āĻā§āĻ¸āĻžāĻāĻ¨ āĻāĻŖāĻ¨āĻž āĻāĻ°āĻ¤ā§ āĻāĻžāĻ¨āĨ¤

āĻĄāĻŋāĻā§āĻ°āĻŋ āĻĨā§āĻā§ āĻ°ā§āĻĄāĻŋā§āĻžāĻ¨ā§ āĻ°ā§āĻĒāĻžāĻ¨ā§āĻ¤āĻ° āĻāĻ°āĻžāĻ° āĻāĻ¨ā§āĻ¯, āĻĄāĻŋāĻā§āĻ°āĻŋāĻā§ pi/180 āĻĻā§āĻŦāĻžāĻ°āĻž āĻā§āĻŖ āĻāĻ°āĻž āĻšāĻŦā§āĨ¤ āĻ°ā§āĻĄāĻŋā§āĻžāĻ¨ āĻĨā§āĻā§ āĻĄāĻŋāĻā§āĻ°āĻŋāĻ¤ā§ āĻ°ā§āĻĒāĻžāĻ¨ā§āĻ¤āĻ° āĻāĻ°āĻžāĻ° āĻāĻ¨ā§āĻ¯, āĻ°ā§āĻĄāĻŋā§āĻžāĻ¨āĻā§ 180/pi āĻĻā§āĻŦāĻžāĻ°āĻž āĻā§āĻŖ āĻāĻ°āĻž āĻšāĻŦā§āĨ¤

Pi is here the fixed circle constant with the rounded value 3.14159...

### Error codes:

5 Invalid procedure call

### Example:

``````
REM āĻ¨āĻŋāĻā§āĻ° āĻāĻĻāĻžāĻšāĻ°āĻŖāĻāĻŋ āĻāĻāĻāĻŋ āĻ¸āĻŽāĻā§āĻ¨ā§ āĻ¤ā§āĻ°āĻŋāĻ­ā§āĻā§āĻ° āĻāĻ¨ā§āĻ¯ āĻāĻ° āĻāĻ¨āĻĒā§āĻ āĻāĻ¨ā§āĻŽā§āĻĻāĻ¨ āĻāĻ°ā§ āĻĨāĻžāĻā§
REM āĻĒāĻ°āĻ¸ā§āĻĒāĻ°āĻā§āĻĻā§ āĻāĻŦāĻ āĻā§āĻ¨ (āĻĄāĻŋāĻā§āĻ°āĻŋāĻ¤ā§) āĻāĻŦāĻ āĻāĻ¤āĻŋāĻ­ā§āĻā§āĻ° āĻĻā§āĻ°ā§āĻā§āĻ¯ āĻāĻŖāĻ¨āĻž āĻāĻ°āĻž āĻšā§:
Sub ExampleCosinus
REM rounded Pi = 3.14159
Dim d1 As Double, dAngle As Double