MathUtil.cs 568 B

123456789101112131415161718
  1. //---------------------------------------------------------------------------------
  2. // Written by Michael Hoffman
  3. // Find the full tutorial at: http://gamedev.tutsplus.com/series/vector-shooter-xna/
  4. //----------------------------------------------------------------------------------
  5. using System;
  6. using AtomicEngine;
  7. namespace AtomicBlaster
  8. {
  9. static class MathUtil
  10. {
  11. public static Vector2 FromPolar(float angle, float magnitude)
  12. {
  13. return magnitude * new Vector2((float)Math.Cos(angle), (float)Math.Sin(angle));
  14. }
  15. }
  16. }