I am trying to convert this velocity into another 2 dimensional vector at some specified angle:float maximumVelocity = 1.5f;float angleInDegrees = 23f;Vector2 actualVelocityAs2DimensionalVector = {?,?}At first, I was going to take 1.5, and rotate it after converting the degrees to radians, like so:double radians = Math.toRadians(angleInDegrees);Vector2 actualVelocityAs2DimensionalVector = new Vector2(x * Math.cos(radians) - y * Math.sin(radians),                                                          x * Math.sin(radians) + y * Math.cos(radians));Is this the fastest way to achieve this? This will be happening a lot in my application, and I would think all the cos and sin calls are somewhat expensive.
Achieving a rotated Vector magnitude
java;performance;coordinate system
You're calling Math.sin() and Math.cos() twice as many times as you need to. double cosine = Math.cos(radians)double sine = Math.sin(radians)Vector2 rotated = new Vector2(x*cosine - y*sine, x*sine + y*cosine)If the angle never changes, then just save the values cosine and sine so you don't have to compute them over and over again.