Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Vector2 a = new Vector2(pathPoint.X, pathPoint.Y);
- Vector2 b = lastPoint;
- double deltax = b.X - a.X;
- double deltay = b.Y - a.Y;
- double angle_rad = Math.Atan2(deltay, deltax);
- double angle_deg = angle_rad * 180.0 / Math.PI;
- pathPoint.RotationZ = (float)angle_rad;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement