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:

Number: 코사인을 계산할 각도λ₯Ό λΌλ””μ•ˆμœΌλ‘œ μ§€μ •ν•˜λŠ” 숫자 μ‹μž…λ‹ˆλ‹€.

도λ₯Ό λΌλ””μ•ˆμœΌλ‘œ λ³€ν™˜ν•˜λ €λ©΄ 도에 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 μ‹œμ»¨νŠΈ 및 각도(도 λ‹¨μœ„)λŠ” λΉ—λ³€μ˜ 길이λ₯Ό κ³„μ‚°ν•©λ‹ˆλ‹€.
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