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

Syntax:


Cos (Number As Double) As Double

Return value:

Double

Parameters:

āļ…āļ‚āļšāļē: āļ”āļļāļ§ āˇƒāļē⎒āļąāļē āļœāļĢāļąāļē āļšāˇ’āļģ⎓āļ¸āļ§ āļ…āˇ€āˇāˇŠâ€āļē āļšāˇāļĢāļē āļģ⎚āļŠāˇ’āļēāļąāˇŠ ⎀āļŊ⎒āļąāˇŠ āļ…āļģ⎊āļŽ āļ¯āļšāˇŠāˇ€āļą āˇƒāļ‚āļ›āˇŠâ€āļēāˇāļ­āˇŠāļ¸āļš āļ´āˇŠâ€āļģāļšāˇāˇāļąāļē.

āļ…āļ‚⎁āļš āļģ⎚āļŠāˇ’āļēāļą āˇ€āļŊāļ§ āļ´āļģ⎒⎀āļģ⎊āļ­āļąāļē āļšāˇ’āļģ⎓āļ¸āļ§ āļ…āļ‚⎁āļš Pi/180āļœāˇ™āļąāˇŠ āļœāˇ”āļĢ āļšāļģāļąāˇŠāļą āˇƒāˇ„ āļģ⎚āļŠāˇ’āļēāļą āļ…āļ‚⎁āļš āˇ€āļŊāļ§ āļ´āļģ⎒⎀āļģ⎊āļ­āļąāļē āļšāˇ’āļģ⎓āļ¸āļ§ āļģ⎚āļŠāˇ’āļēāļą 180/Piāļœāˇ™āļąāˇŠ āļœāˇ”āļĢ āļšāļģāļąāˇŠāļą.

āļ…āļ‚⎁āļš=(āļģ⎚āļŠāˇ’āļēāļą*180)/Pi

āļģ⎚āļŠāˇ’āļēāļą=(āļ…āļ‚⎁āļš*Pi)/180

Pi is here the fixed circle constant with the rounded value 3.14159...

Error codes:

5 Invalid procedure call

Example:


' 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 hypotenuse is"; (d1 / cos (dAngle * Pi / 180))
End Sub

Please support us!