Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.35 KB | None | 0 0
  1.             Vector2 a = new Vector2(pathPoint.X, pathPoint.Y);
  2.  
  3.             Vector2 b = lastPoint;
  4.  
  5.             double deltax = b.X - a.X;
  6.             double deltay = b.Y - a.Y;
  7.  
  8.             double angle_rad = Math.Atan2(deltay, deltax);
  9.             double angle_deg = angle_rad * 180.0 / Math.PI;
  10.  
  11.             pathPoint.RotationZ = (float)angle_rad;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement