ThalesGroup / kessler-game

Kessler is a simulation environment loosely modeled after our internal project PsiBee and the external project Fuzzy Asteroids. The game has ships that shoot bullets at asteroids to gain score. Ships can collide with asteroids and other ships and lose lives.
https://github.com/ThalesGroup/kessler-game
Apache License 2.0
8 stars 5 forks source link

Use math.radians and math.degrees consistently #39

Closed Jie-F closed 6 months ago

Jie-F commented 7 months ago

In the code, there are two places that use the manual thetapi/180 or theta180/pi calculations. This is slower than the math.radians or math.degrees which only does one floating point multiplication in C, compared to one float multiplication and float division in Python, which is over twice as slow. Additionally, the two conversion methods produce slightly different results due to floating point imprecision.