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 āĻĻā§āĻŦāĻžāϰāĻž āϗ⧁āĻŖ āĻ•āϰāĻž āĻšāĻŦ⧇āĨ¤

degree=(radian*180)/pi

radian=(degree*pi)/180

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

Error codes:

5 Invalid procedure call

Example:


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

Please support us!