26 lines
659 B
Python
26 lines
659 B
Python
|
import math
|
||
|
|
||
|
def generate_sin_cos_array():
|
||
|
sin_values = []
|
||
|
cos_values = []
|
||
|
for i in range(-180, 180):
|
||
|
sin_values.append(math.sin(math.radians(i)))
|
||
|
cos_values.append(math.cos(math.radians(i)))
|
||
|
|
||
|
print("float PreCalcSin[360] = {")
|
||
|
for i in range(360):
|
||
|
if i % 5 == 0:
|
||
|
print("\n ", end="")
|
||
|
print("{:.8f}, ".format(sin_values[i]), end="")
|
||
|
print("\n};\n")
|
||
|
|
||
|
print("float PreCalcCos[360] = {")
|
||
|
for i in range(360):
|
||
|
if i % 5 == 0:
|
||
|
print("\n ", end="")
|
||
|
print("{:.8f}, ".format(cos_values[i]), end="")
|
||
|
print("\n};\n")
|
||
|
|
||
|
|
||
|
generate_sin_cos_array()
|