Funció Tan

Determina la tangent d'un angle. L'angle s'especifica en radians.

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

Sintaxi:


Tan (Number As Double) As Double

Valor de retorn:

Double

Paràmetres:

Nombre: Qualsevol expressió numèrica de la qual vulgueu calcular la tangent (en radians).

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

degrees=(radians*180)/Pi

radians=(degrees*Pi)/180

El valor de Pi és aproximadament de 3,141593.

Codis d'error

5 La crida al procediment no és vàlida

Exemple:


' En aquest exemple, l'entrada següent és possible per a un triangle rectangle:
' El costat oposat a l'angle i l'angle (en graus) per calcular la longitud del costat adjacent a l'angle:
Sub ExampleTangens
' Pi = 3,1415926 és una variable predefinida
Dim d1 As Double
Dim dAlpha As Double
    d1 = InputBox("Introduïu la longitud del costat oposat de l'angle: ","oposat")
    dAlpha = InputBox("Introduïu l'angle Alpha (en graus): ","Alpha")
    Print "la longitud del costat adjacent de l'angle és"; (d1 / tan (dAlpha * Pi / 180))
End Sub

Ens cal la vostra ajuda!