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:

αž‘αŸ’αžœαŸ

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 αž€αžΆαžšβ€‹αž αŸ…β€‹αž”αŸ‚αž”αž”αž‘β€‹αž˜αž·αž“β€‹αžαŸ’αžšαžΉαž˜αžαŸ’αžšαžΌαžœ

Example:


REM The following example allows for a right-angled triangle the input of
REM 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

Please support us!