Пример #1
0
        private static double DistanceToEllipse(clsPoint pt, RotatedRect rect)
        {
            var c = rect.Center;
            var a = rect.Angle * PI / 180f;

            pt.Move(-c.X, -c.Y);
            pt.Rotate(-a);
            var pt2 = NearestPointOnEllipse(pt, rect.Size.Width / 2, rect.Size.Height / 2);

            return(pt.Dist(pt2));
        }
Пример #2
0
        public static clsPoint ProjectPoint(clsPoint p1, clsLine l1)
        {
            double   d   = 0;
            clsPoint pt1 = new clsPoint();
            clsLine  l2  = new clsLine();

            d   = Dist(p1, l1);
            pt1 = p1.Copy();
            l2  = (clsLine)l1.Normal();
            l2.Normalise();
            l2.Scale(-d);
            pt1.Move(l2.P2.X, l2.P2.Y);
            return(pt1);
        }
Пример #3
0
 public void Move(double x, double y)
 {
     myCentre.Move(x, y);
 }