Cos Function
Calculates the cosine of an angle. The angle is specified in radians. The result lies between -1 and 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:
Abs (Number)
рд╡рд╛рдкрд╕реА рдореВрд▓реНрдп:
рджреЛрдЧреБрдирд╛
рдкреИрд░рд╛рдореАрдЯрд░
Number: Numeric expression that specifies an angle in radians that you want to calculate the cosine for.
рдбрд┐рдЧреНрд░реА рдХреЛ рд░реЗрдбрд┐рдпрди рдореЗрдВ рдмрджрд▓рдиреЗ рдХреЗ рд▓рд┐рдП, рдбрд┐рдЧреНрд░реА рдХреЛ pi/180 рд╕реЗ рдЧреБрдгрд╛ рдХрд░реЗрдВ. рд░реЗрдбрд┐рдпрди рдХреЛ рдбрд┐рдЧреНрд░реА рдореЗрдВ рдмрджрд▓рдиреЗ рдХреЗ рд▓рд┐рдП, рд░реЗрдбрд┐рдпрди рдХреЛ 180/pi рд╕реЗ рдЧреБрдгрд╛ рдХрд░реЗрдВ.
grad=(radiant*180)/pi
radiant=(grad*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