XNA MathHelper

Published on 28 November 2010

❗❗ I invite you to sign up for my DevNews newsletter 💌. DevNews is issued weekly and consist of carefully selected digest of tech-news from last week. Don't wait❗❗ Sign up today

Today just a short note. Recently I've been working on a XNA project. In my project I needed to rotate line. I used that calculation:

float angle = (float)Math.Atan2(point2.Y - point1.Y, point2.X - point1.X);

to calculate the angle in radians and the use **angle **in SpriteBatch.Draw() method. Recently I found MathHelper class from XNA. I has a lot of useful methods. One of those is:


This is what I was looking for!

comments powered by Disqus