CSharp examples for System:Math Geometry
Standard Euclidean distance between 2 points.
using System.Drawing; using System;//from w w w . j a v a 2 s .co m public class Main{ /// <summary> /// Standard Euclidean distance between 2 points. /// </summary> public static double EuclideanDistance(Point a, Point b) { int dx = b.X - a.X; int dy = b.Y - a.Y; return Math.Sqrt((dx * dx) + (dy * dy)); } }