for the origin you just place in the origin parameter for spritebatch this

, new Vector2(image.Width *.5, image.Height *.5),

to get radians from degrees you just basically multiply them by the magic number 0.0745329

to get degrees from radians same thing multiply rads by 57.29577

these numbers come from 360 / (2pi) , and (2pi) / 360

*I have no idea why we donâ€™t just use 0 to 1 though radianâ€™s have some relation to a circle they have nothing to do with actual rotating or sin cos rotation is more about pythagorean theorum.*

public static float DegreesToRadians(float degrees)

{

return degrees * .017453292519f;

}

public static float RadiansToDegrees(float radians)

{

return radians * 57.2957795130f;

}

A couple more that might help or you might need later.

public static Vector2 RadiansToDirection(float radians)

{

return new Vector2(-(float)(Math.Sin(radians)), (float)(Math.Cos(radians)));

}

public static float DirectionToRadians(Vector2 direction)

{

return (float)Math.Atan2(direction.X, direction.Y);

}

Just beware that atan 2 works off polar quadrants i think so you have to adjust for that.

to say math uses up as 0 degrees but wants y,x and xna right is 0 degrees because the rotation has to be based on some set of quadrants which is different then maths.

```
public static void DrawToScreenCentered(Texture2D textureobj, Rectangle scrdraw_rect, Rectangle texturerect, float rot)
{
Vector2 toff = new Vector2(texturerect.Width * .5f, texturerect.Height * .5f);
BxEngien.Spritebatch.Draw(textureobj, scrdraw_rect, texturerect, spritecolor, rot, toff, flipeffect, 0);
}
public static void DrawToScreenCentered(Texture2D textureobj, Vector2 position, Rectangle texturerect,float rot, float scale)
{
Vector2 toff = new Vector2(texturerect.Width * .5f, texturerect.Height * .5f);
BxEngien.Spritebatch.Draw(textureobj, position, texturerect, spritecolor, rot,Vector2.Zero, scale, flipeffect, 0);
}
public static void DrawToScreenCentered(Texture2D textureobj, Rectangle scrdraw_rect, Rectangle texturerect, float rot, float scale)
{
scrdraw_rect.Width = (int)(scrdraw_rect.Width * scale);
scrdraw_rect.Height = (int)(scrdraw_rect.Height * scale);
Vector2 toff = new Vector2(texturerect.Width * .5f, texturerect.Height * .5f);
BxEngien.Spritebatch.Draw(textureobj, scrdraw_rect, texturerect, spritecolor, rot, toff, flipeffect, 0);
}
public static void DrawToScreenRects(Texture2D textureobj, Rectangle screenrect, Rectangle texturerect, float rot)
{
screenrect.X += (int)(screenrect.Width * .5f);
screenrect.Y += (int)(screenrect.Height * .5f);
Vector2 toff = new Vector2(texture_offset.X + texturerect.Width * .5f, texture_offset.Y + texturerect.Height * .5f);
BxEngien.Spritebatch.Draw(textureobj, screenrect, texturerect, SpriteColor, rot, toff, flip_effect, 0);
}
```

note

Just replace bxengien with a reference to your passed graphicsdevice, i have mine in my engien as a static updated reference. the third version is basically for if your working with a spritesheet or image with multiple pictures it allows you to do the with that the same as you would with a single image. The fourth version adjust for what centering does to screendraw coordinates if you desire to cancel out that translation effect.

rot is rotation pass in radians, scale you can just pass 1.0 if you donâ€™t want to scale it.