Ayuda de LibreOffice 24.8
Calcula'l cosenu d'un ángulu. L'ángulu especificar en radianes. La resultancia ta ente -1 y 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.
Cos(Alpha) = Adjacent/Hypotenuse
Cos (Number As Double) As Double
Double
Númberu: Espresión numbérica qu'especifica un ángulu en radianes pal que se deseya calcular el cosenu.
Pa convertir graos a radianes, multiplique los graos por pi/180. Pa convertir radianes a graos, multiplique los radianes por 180/pi.
grau=(radián*180)/pi
radián=(grado*pi)/180
Pi is here the fixed circle constant with the rounded value 3.14159...
' L'exemplu siguiente dexa pa un triángulu rectángulu la entrada de
' la secante y l'ángulu (en graos) y calcula el llargor de la hipotenusa:
Sub ExampleCosinus
' arredondiáu Pi = 3.14159
Dim d1 As Double, dAngle As Double
d1 = InputBox$ (""Escriba'l llargor del llau axacente: ","Axacente")
dAngle = InputBox("Escriba l'ángulu Alfa (en graos): ","Alfa")
Print "The length of the hypotenuse is"; (d1 / cos (dAngle * Pi / 180))
End Sub