How to calculate xSpeed and ySpeed according to float value of rotation?

Hey guys,
We are working on a bullet hell game and we spent days trying to figure out how to change xSpeed and ySpeed according to bullets rotation. We finally figured that we can do it like this:

moveDirection = new Vector3(xSpeed, ySpeed, 0f);
moveDirection = transform.TransformDirection(moveDirection); 
//Previous line adjusts our xSpeed and ySpeed according to the rotation of this object.

But the problem is that we need rotation of the object for something else. So we are trying to figure out a formula how to change xSpeed and ySpeed according to the rotation without using transform component.
Here is one way we tried doing it but it failed short:

 moveDirection.x = xSpeed * Mathf.Cos(currentRotation);
 moveDirection.y = ySpeed * Mathf.Sin(currentRotation);
//currentRotation is our float that should determine rotation of this object

or

float radians = (Mathf.PI / 180f) * (currentRotation - 90f); 
moveDirection.x = xSpeed * Mathf.Cos(radians);
moveDirection.y = ySpeed * Mathf.Sin(radians);

This one would work well if we just had one bullet speed. But since we have both xSpeed and ySpeed that both need to be affected by rotation, this code is not working out.

Do you guys know any way how we can calculate both xSpeed and ySpeed according to float value of rotation.

Thanks!

if I understand correctly, you want to use your X and Y speed variables as the forward and right speed of the object, but programmatically rotate the forward and right of the object (the angle).

Try:

Vector3 transformedSpeed = Quaternion.AngleAxis(currentRotation, Vector3.up) * new Vector3(xSpeed, 0f, ySpeed);
moveDirection.x = transformedSpeed.x;
moveDirection.y = transformedSpeed.z;