# Tan Function

āĻāĻāĻāĻŋ āĻā§āĻ¨ā§āĻ° āĻā§āĻ¨āĻā§āĻ¨ā§āĻ āĻ¨āĻŋāĻ°ā§āĻ§āĻžāĻ°āĻŖ āĻāĻ°āĻž āĻšā§āĨ¤ āĻā§āĻ¨āĻāĻŋ āĻ°ā§āĻĄāĻŋā§āĻžāĻ¨ā§ āĻāĻ˛ā§āĻ˛ā§āĻ āĻāĻ°āĻž āĻšā§āĨ¤

Using the angle Alpha, the Tan function calculates the ratio of the length of the side opposite the angle to the length of the side adjacent to the angle in a right-angled triangle.

Tan(Alpha) = side opposite the angle/side adjacent to angle

### Syntax:

``````
Tan (Number As Double) As Double
``````

Double

### Parameters:

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

To convert degrees to radians, multiply by Pi/180. To convert radians to degrees, multiply by 180/Pi.

Pi is approximately 3.141593.

### Error codes:

5 Invalid procedure call

### Example:

``````
REM āĻāĻ āĻāĻĻāĻžāĻšāĻ°āĻŖā§, āĻ¨āĻŋāĻā§āĻ° āĻāĻ¨ā§āĻā§āĻ°āĻŋāĻāĻŋ āĻ¸āĻŽāĻā§āĻ¨ā§ āĻ¤ā§āĻ°āĻŋāĻ­ā§āĻā§āĻ° āĻāĻ¨ā§āĻ¯ āĻ¸āĻŽā§āĻ­āĻžāĻŦā§āĻ¯:
REM āĻā§āĻ¨ā§āĻ° āĻŦāĻŋāĻĒāĻ°ā§āĻ¤ āĻŦāĻžāĻšā§ āĻāĻŦāĻ āĻā§āĻ¨ āĻ¸āĻāĻļā§āĻ˛āĻŋāĻˇā§āĻ āĻŦāĻžāĻšā§āĻ° āĻĻā§āĻ°ā§āĻā§āĻ¯ āĻāĻŖāĻ¨āĻž āĻāĻ°āĻžāĻ° āĻāĻ¨ā§āĻ¯ āĻā§āĻ¨ (āĻĄāĻŋāĻā§āĻ°āĻŋāĻ¤ā§):
Sub ExampleTangens
REM Pi = 3.1415926 āĻĒā§āĻ°ā§āĻŦāĻŋāĻ¨āĻŋāĻ°ā§āĻ§āĻžāĻ°āĻŋāĻ¤ āĻ­ā§āĻ°āĻŋā§ā§āĻŦāĻ˛
Dim d1 As Double
Dim dAlpha As Double
d1 = InputBox("Enter the length of the side opposite the angle: ","opposite")
ddAlpha = InputBox("Enter the Alpha angle (in degrees): ","Alpha")
Print "the length of the side adjacent the angle is"; (d1 / tan (dAlpha * Pi / 180))
End Sub
``````