こんな感じでしょうか?
python3
1#!/usr/bin/env python3
2
3import math
4
5def triangle(degree):
6 rad = math.radians(degree)
7 return math.sin(rad), math.cos(rad), math.tan(rad)
8
9def main():
10 print("degree sin cos tan ")
11 for i in range(0, 85):
12 sin, cos, tan = triangle(i)
13 print("{:6} {:.2f} {:.2f} {:.2f}".format(i, sin, cos, tan))
14
15if __name__ == '__main__':
16 main()
実行すると、以下のようになります。
sh
1$ python3 main.py
2degree sin cos tan
3 0 0.00 1.00 0.00
4 1 0.02 1.00 0.02
5 2 0.03 1.00 0.03
6 3 0.05 1.00 0.05
7 4 0.07 1.00 0.07
8 5 0.09 1.00 0.09
9 6 0.10 0.99 0.11
10 7 0.12 0.99 0.12
11 8 0.14 0.99 0.14
12 9 0.16 0.99 0.16
13 10 0.17 0.98 0.18
14 11 0.19 0.98 0.19
15 12 0.21 0.98 0.21
16 13 0.22 0.97 0.23
17 14 0.24 0.97 0.25
18 15 0.26 0.97 0.27
19 16 0.28 0.96 0.29
20 17 0.29 0.96 0.31
21 18 0.31 0.95 0.32
22・
23・
手元のパソコンで試してもらえればと思います。
ちなみに、自分はPython3を使っています。