25 lines
659 B
Python
Executable file
25 lines
659 B
Python
Executable file
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()
|