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!