public static double GetHypoteneuseLength(Point p1, Point p2) { int xDiff = Math.Abs(p1.X - p2.X); int yDiff = Math.Abs(p1.Y - p2.Y); return Math.Sqrt(Math.Pow(xDiff, 2) + Math.Pow(yDiff, 2)); }