Axuda do LibreOffice 24.8
Calcula o coseno dun ángulo. O ángulo especifícase en radiáns. O resultado está entre -1 e 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
Number: Numeric expression that specifies an angle in radians that you want to calculate the cosine for.
Para converter graos en radiáns, multiplique os graos por pi/180. Para converter radiáns en graos, multiplique os radiáns por 180/pi.
grao=(radián*180)/pi
radián=(grao*pi)/180
Pi is here the fixed circle constant with the rounded value 3.14159...
REM O seguinte exemplo permite, para un triángulo rectángulo, a entrada de
REM a secante e o ángulo (en graos) e calcula a lonxitude da hipotenusa:
Sub ExampleCosinus
REM Pi arredondado = 3.14159
Dim d1 As Double, dAngle As Double
d1 = InputBox$ (""Introduza a lonxitude do lado adxacente: ","Adxacente")
dAngle = InputBox("Introduza o ángulo Alfa (en graos): ","Alfa")
Print "The length of the hypotenuse is"; (d1 / cos (dAngle * Pi / 180))
End Sub