角度と底辺の長さから、斜辺と高さ計算するサンプル
import math
# 角度
angle = 45
# 底辺
bottom = 10
# 角度と底辺から斜辺を求める
hypotenuse = bottom / math.cos(math.pi * angle / 180)
# 角度と底辺から高さを求める
height = bottom * math.tan(math.pi * angle / 180)
print(hypotenuse)
print(height)
戻る
ホームページ テンプレート フリー
Design by