LibreOffice 7.6 Help
āĻāĻāĻāĻŋ āĻā§āύā§āϰ āĻā§āϏāĻžāĻāύ āĻāĻŖāύāĻž āĻāϰ⧠āĻĨāĻžāĻā§āĨ¤ āĻā§āύāĻāĻŋ āϰā§āĻĄāĻŋā§āĻžāύ⧠āĻāϞā§āϞā§āĻ āĻāϰ⧠āĻĨāĻžāĻā§āĨ¤ āĻĢāϞāĻžāĻĢāϞ -1 āĻāĻŦāĻ 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
āϏāĻāĻā§āϝāĻž: āϏāĻāĻā§āϝāĻžāϏā§āĻāĻ āĻāĻā§āϏāĻĒā§āϰāĻļā§āĻļāύ āϝāĻž āĻāĻāĻāĻŋ āĻā§āύ āϰā§āĻĄāĻŋā§āĻžāύ⧠āĻāϞā§āϞā§āĻ āĻāϰ⧠āĻĨāĻžāĻā§ āĻāĻŦāĻ āϝāĻžāϰ āĻā§āϏāĻžāĻāύ āĻāĻŖāύāĻž āĻāϰāϤ⧠āĻāĻžāύāĨ¤
āĻĄāĻŋāĻā§āϰāĻŋ āĻĨā§āĻā§ āϰā§āĻĄāĻŋā§āĻžāύ⧠āϰā§āĻĒāĻžāύā§āϤāϰ āĻāϰāĻžāϰ āĻāύā§āϝ, āĻĄāĻŋāĻā§āϰāĻŋāĻā§ pi/180 āĻĻā§āĻŦāĻžāϰāĻž āĻā§āĻŖ āĻāϰāĻž āĻšāĻŦā§āĨ¤ āϰā§āĻĄāĻŋā§āĻžāύ āĻĨā§āĻā§ āĻĄāĻŋāĻā§āϰāĻŋāϤ⧠āϰā§āĻĒāĻžāύā§āϤāϰ āĻāϰāĻžāϰ āĻāύā§āϝ, āϰā§āĻĄāĻŋā§āĻžāύāĻā§ 180/pi āĻĻā§āĻŦāĻžāϰāĻž āĻā§āĻŖ āĻāϰāĻž āĻšāĻŦā§āĨ¤
degree=(radian*180)/pi
radian=(degree*pi)/180
Pi is here the fixed circle constant with the rounded value 3.14159...
REM āύāĻŋāĻā§āϰ āĻāĻĻāĻžāĻšāϰāĻŖāĻāĻŋ āĻāĻāĻāĻŋ āϏāĻŽāĻā§āύ⧠āϤā§āϰāĻŋāĻā§āĻā§āϰ āĻāύā§āϝ āĻāϰ āĻāύāĻĒā§āĻ āĻ
āύā§āĻŽā§āĻĻāύ āĻāϰ⧠āĻĨāĻžāĻā§
REM āĻĒāϰāϏā§āĻĒāϰāĻā§āĻĻā§ āĻāĻŦāĻ āĻā§āύ (āĻĄāĻŋāĻā§āϰāĻŋāϤā§) āĻāĻŦāĻ āĻ
āϤāĻŋāĻā§āĻā§āϰ āĻĻā§āϰā§āĻā§āϝ āĻāĻŖāύāĻž āĻāϰāĻž āĻšā§:
Sub ExampleCosinus
REM rounded Pi = 3.14159
Dim d1 As Double, dAngle As Double
d1 = InputBox$ (""Enter the length of the adjacent side: ","Adjacent")
dAngle = InputBox("Enter the angle Alpha (in degrees): ","Alpha")
Print "The length of the hypotenuse is"; (d1 / cos (dAngle * Pi / 180))
End Sub