Cos Function
āļāˇāļĢāļēāļ āˇāļēāˇāļąāļē āļāļ´āˇāˇ āļŊāļļāˇ āļ¯āˇāļēāˇ. āļāˇāļĢāļē āļģāˇāļŠāˇāļēāļąāˇ āˇāļŊāˇāļąāˇ āˇāˇāˇāˇāˇāļĢāļē āļāļģ āļāļ. āļ´āˇâāļģāļāˇāļĩāļŊāļē -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
āļāˇāļģāļ āļģāˇāļāˇāļē:
Log (Number)
āļāļ´āˇāˇ āļŊāļļāˇāļ¯āˇāļą āļ āļāļē:
Double
āļ´āļģāˇāļ¸āˇāļāˇāļąāˇ:
āļ āļāļāļē: āļāļļāļ§ āˇāļēāˇāļąāļē āļāļĢāļąāļē āļāˇāļģāˇāļ¸āļ§ āļ āˇāˇāˇâāļē āļāˇāļĢāļē āļģāˇāļŠāˇāļēāļąāˇ āˇāļŊāˇāļąāˇ āļ āļģāˇāļŽ āļ¯āļāˇāˇāļą āˇāļāļāˇâāļēāˇāļāˇāļ¸āļ āļ´āˇâāļģāļāˇāˇāļąāļē.
āļ āļāˇāļ āļģāˇāļŠāˇāļēāļą āˇāļŊāļ§ āļ´āļģāˇāˇāļģāˇāļāļąāļē āļāˇāļģāˇāļ¸āļ§ āļ āļāˇāļ Pi/180āļāˇāļąāˇ āļāˇāļĢ āļāļģāļąāˇāļą āˇāˇ āļģāˇāļŠāˇāļēāļą āļ āļāˇāļ āˇāļŊāļ§ āļ´āļģāˇāˇāļģāˇāļāļąāļē āļāˇāļģāˇāļ¸āļ§ āļģāˇāļŠāˇāļēāļą 180/Piāļāˇāļąāˇ āļāˇāļĢ āļāļģāļąāˇāļą.
āļ āļāˇāļ=(āļģāˇāļŠāˇāļēāļą*180)/Pi
āļģāˇāļŠāˇāļēāļą=(āļ āļāˇāļ*Pi)/180
Pi is here the fixed circle constant with the rounded value 3.14159...
āļāļ¯āˇāˇāļģāļĢāļē:
' The following example allows for a right-angled triangle the input of
' secant and angle (in degrees) and calculates the length of the hypotenuse:
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 hypothenuse is"; (d1 / cos (dAngle * Pi / 180))
End Sub