# 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 ααΆαβα αβαααααβαα·αβααααΉαααααΌα

### Example:

``````
REM In this example, the following entry is possible for a right-angled triangle:
REM αααααβαααβααβαααβαα»αβααΉαβαα»α αα·αβαα»αβ (αα·αβααΆβααΊαααα)β ααΎααααΈβααααΆβααααααβααααβαααααβαααβααβααΆααβααΉαβαα»α α
Sub ExampleTangens
REM Pi = 3.1415926 is a pre-defined variable
Dim d1 As Double
Dim dAlpha As Double
d1 = InputBox("Enter the length of the side opposite the angle: ","opposite")
dAlpha = 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
``````