# Vector for bullet direction XNA C#

im creating a platform shooter. the gun can be rotated using the thumbsticks. i want to use a line of fire newBullet.bulletVel variable as a Vector 2. this variable will be used to send the bullet in the direction that the barrel of the weapon is pointed at. How could i do this?

for gun rotation i have declared a float named rotation and use spritebatch.draw method to show that the variable is for rotation of the image.

public float WMrotation;

public void UpdateMe(GameTime gameTime)
{
{
WMrotation += 0.03f;
}
{
WMrotation -= 0.03f;
}
}

public void DrawMe(SpriteBatch sb)
{
sb.Draw(WMtxr, WMpos, null, Color.White, WMrotation, WMorigin, 1f, SpriteEffects.None, 0);
}


ive set the bullet position when fired to be at the tip of the gun.

newBullet.bulletPos.X = player1.playerPosition.X + 15;
newBullet.bulletPos.Y = player1.playerPosition.Y + 15;


i think i need to use newBullet.bulletVel to calculate the vector in which the bullet travels

newBullet.bulletVel = i don't know what to put in here


Any help would be appreciated.

x = cos(angle)