Calculate Points Around A Circle In Android
I'm programming a game in android where an enemy ship needs to fire in a star pattern around itself. Basically, for any X number of shots I set the enemy ship to fire, I want it to
Solution 1:
The trigonometric functions in most programming languages, Java included, measure the argument in radians, not degrees. There is a helper function to do the conversion, so everywhere you call sin
or cos
you can add a call to toRadians
:
Math.cos(Math.toRadians(dAngle))
Post a Comment for "Calculate Points Around A Circle In Android"