Beispiel #1
0
        private double Distance(BaseModels.Point p, LineD line)
        {
            var p1 = line.Point1;
            var p2 = line.Point2;

            return(Math.Abs(
                       ((p2.Y - p1.Y) * p.X + (p1.X - p2.X) * p.Y + (p1.Y - p2.Y) * p1.X + (p2.X - p1.X) * p1.Y) /
                       Math.Sqrt((p2.Y - p1.Y) * (p2.Y - p1.Y) + (p1.X - p2.X) * (p1.X - p2.X))
                       ));
        }
Beispiel #2
0
 public LineD(BaseModels.Point point1, BaseModels.Point point2)
 {
     Point1 = point1;
     Point2 = point2;
 }