CSharp examples for System:Math Geometry
Get Distance between two vectors
using Microsoft.Xna.Framework; using System;//from w ww .j av a 2 s . c o m public class Main{ public static double GetDistance(Vector2 startPoint, Vector2 endPoint) { var deltaX = Math.Abs(startPoint.X - endPoint.X); var deltaY = Math.Abs(startPoint.Y - endPoint.Y); var multi = deltaX*deltaX + deltaY*deltaY; return Math.Sqrt(multi); } }