Cos Function
๊ฐ๋์ ์ฝ์ฌ์ธ์ ๊ณ์ฐํฉ๋๋ค. ๊ฐ๋๋ ๋ผ๋์์ผ๋ก ์ง์ ๋ฉ๋๋ค. ๊ฒฐ๊ณผ๋ -1์์ 1 ์ฌ์ด์ ๋๋ค.
Cos ํจ์๋ ๊ฐ๋ Alpha์ ์ธ์ ํ ๋ฐ๋ณ์ ๊ธธ์ด๋ฅผ ์ง๊ฐ ์ผ๊ฐํ์ ๋น๋ณ ๊ธธ์ด๋ก ๋๋ ๋น์จ์ ๊ณ์ฐํฉ๋๋ค.
Cos(Alpha) = Adjacent/Hypotenuse
๊ตฌ๋ฌธ:
Cos (Number)
๋ฐํ ๊ฐ:
Double
๋งค๊ฐ ๋ณ์:
Number: ์ฝ์ฌ์ธ์ ๊ณ์ฐํ ๊ฐ๋๋ฅผ ๋ผ๋์์ผ๋ก ์ง์ ํ๋ ์ซ์ ์์ ๋๋ค.
๋๋ฅผ ๋ผ๋์์ผ๋ก ๋ณํํ๋ ค๋ฉด ๋์ pi/180์ ๊ณฑํฉ๋๋ค. ๋ผ๋์์ ๋๋ก ๋ณํํ๋ ค๋ฉด ๋ผ๋์์ 180/pi๋ฅผ ๊ณฑํฉ๋๋ค.
degree=(radian*180)/pi
radian=(degree*pi)/180
์ฌ๊ธฐ์์ Pi๋ 3.14159... ๋ฅผ ๋ฐ์ฌ๋ฆผํ ๊ฐ์ ๊ฐ๋ ๊ณ ์ ์์ฃผ์จ์ ๋๋ค.
์:
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