■2倍角の公式
2倍角の公式は加法定理から算出することができる。
▼2倍角の公式
■例題
角度α = 60°のとき、以下の値を求める。
問題1
sin2α
問題2
cos2α
問題3
tan2α
■サンプルコード
# -*- Coding:UTF-8 -*-
import math
# 角度を変数に格納
degree = 60
degree_2 = degree * 2
# ラジアンに変換
radian = math.radians(degree)
radian_2 = math.radians(degree_2)
#問題1 sin2α = 2sinαcosα
result = 2 * math.sin(radian) * math.cos(radian)
result_2 = math.sin(radian_2)
print('問題1')
print('2sin60°cos60° = ', result)
print('sin120° = ', result_2)
#問題2 cos2α = 1 - 2(sinα ** 2)
result = 1 - 2 * (math.sin(radian) ** 2)
result_2 = math.cos(radian_2)
print('問題2')
print('1 - 2(sin60° ** 2) = ', result)
print('cos120° = ', result_2)
#問題3 tan2α = 2tanα / 1 - (tanα ** 2)
result = (2 * math.tan(radian)) / ( 1 - (math.tan(radian) ** 2))
result_2 = math.tan(radian_2)
print('問題3')
print('2tan60° / 1 - (tan60° ** 2) = ', result)
print('tan120° = ', result_2)
■実行結果
問題1
2sin60°cos60° = 0.8660254037844388
sin120° = 0.8660254037844388
問題2
1 - 2(sin60° ** 2) = -0.4999999999999998
cos120° = -0.4999999999999998
問題3
2tan60° / 1 - (tan60° ** 2) = -1.7320508075688783
tan120° = -1.7320508075688783