LibreOffice 24.8 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