파이썬 math.sin() 메서드
예시
다른 숫자의 사인 찾기:
# Import math Library
import math
# Return the sine of different
values
print (math.sin(0.00))
print (math.sin(-1.23))
print (math.sin(10))
print (math.sin(math.pi))
print
(math.sin(math.pi/2))
정의 및 사용
이 math.sin()
메서드는 숫자의 사인을 반환합니다.
참고: 각도 사인을 찾으려면 먼저 이 방법을 사용하여 라디안으로 변환해야 합니다(아래 예 참조).
math.radians()
통사론
math.sin(x)
매개변수 값
Parameter | Description |
---|---|
x | Required. The number to find the sine of. If the value is not a number, it returns a TypeError |
기술적 세부 사항
반환 값: | float 각도의 사인을 나타내는 -1에서 1 사이 의 값 |
---|---|
파이썬 버전: | 1.4 |
더 많은 예
예시
다른 차수의 사인 찾기:
# Import math Library
import math
# Return the sine value of 30
degrees
print(math.sin(math.radians(30)))
# Return the sine value
of 90 degrees
print(math.sin(math.radians(90)))