gadget-kspconsole/gentables.py
Daniele Lacamera b8a7ffcd31 Initial import
2023-11-27 15:16:45 +01:00

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()