# \[수학] 삼각함수 - 사인 / 코사인 / 탄젠트

### 코드

{% code title="값이 라디안인 사인/코사인/탄젠트를 구할 때" %}

```
@수학 (값)의 사인
@수학 (값)의 코사인
@수학 (값)의 탄젠트
```

{% endcode %}

{% code title="값이 각도인 사인/코사인/탄젠트를 구할 때" %}

```
@수학 사인 (각도)도
@수학 코사인 (각도)도
@수학 탄젠트 (각도)도
```

{% endcode %}

***

### 설명

입력값($$\theta$$) 라디안 또는 각도를 기준으로 삼각함수 값을 계산합니다.

* 사인: $$\sin(\theta)$$
* 코사인: $$\cos(\theta)$$
* 탄젠트: $$\tan(\theta)$$
* 도 단위 변환 시: $$\sin(\theta^\circ) = \sin\left(\frac{\pi}{180} \times \theta\right)$$

***

### 주의사항

* 수학 코드를 쓸 때는 앞에 `@수학`을 써야 해요.
* `@수학(값)의 사인/코사인/탄젠트` 는 라디안을 기준으로 값을 구해요.
* `@수학 사인/코사인/탄젠트 (각도)도`는 도 단위을 기준으로 값을 구해요.

***

### 파이썬 대응 코드

```
import math
math.sin(x)   # 라디안
math.cos(x)
math.tan(x)
math.sin(math.radians(deg))  # 도 → 라디안
```

***

### 예시

{% code title="예시 코드" %}

```
# 사인/코사인/탄젠트 (라디안)
@수학 ((@수학 파이)/2)의 사인 보여주기 # 사인(π/2) = 사인 90도
@수학 0의 코사인 보여주기
@수학 0의 탄젠트 보여주기

# 사인/코사인/탄젠트 (도)
@수학 사인 30도 보여주기
@수학 코사인 60도 보여주기
@수학 탄젠트 45도 보여주기
```

{% endcode %}

{% code title="예시 코드의 결과" %}

```
1  # π/2(90도)의 사인
1  # 0의 코사인
0  # 0의 탄젠트
0.49999999999999994 # 사인 30도
0.5000000000000001  # 코사인 60도
0.9999999999999999  # 탄젠트 45도
```

{% endcode %}

***

### 검색 키워드

수학, 삼각함수, 사인, 코사인, 탄젠트


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://codebook.horang.it/math/undefined-4.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
