底辺と高さから、角度と斜辺を計算するサンプル
import math
# 底辺
bottom = 2
# 高さ
height = 1
# 底辺と高さから角度を求める
angle = math.atan(height / bottom) * 180 / math.pi
# 底辺と高さから斜辺を求める
hypotenuse = math.sqrt(math.pow(bottom, 2) + math.pow(height, 2))
print(angle)
print(hypotenuse)
戻る
ホームページ テンプレート フリー
Design by