Esempio n. 1
0
 public override bool Contains(PointF pnt)
 {
     float r = Radius, s = pnt.Distance(GetCenter());
     return s <= r;
 }
Esempio n. 2
0
 public override float DistanceTo2(PointF pnt)
 {
     var cnt = GetCenter();
     return pnt.DistancePow2(cnt) - 2 * pnt.Distance(cnt) * Radius + Radius * Radius;
 }
        public double GetDistance()
        {
            GenericPointViewModel genericPoint1 = CanvasChildren[0];
            GenericPointViewModel genericPoint2 = CanvasChildren[1];

            PointF relativePoint1 = new PointF((float)genericPoint1.XRatio * Image.Width, (float)genericPoint1.YRatio * Image.Height);
            PointF relativePoint2 = new PointF((float)genericPoint2.XRatio * Image.Width, (float)genericPoint2.YRatio * Image.Height);

            double dist = relativePoint1.Distance(relativePoint2);

            return dist;
        }
Esempio n. 4
0
 public override float DistanceTo(PointF pnt)
 {
     return pnt.Distance(GetCenter()) - Radius;
 }
Esempio n. 5
0
        public void DistanceTest(double x1, double y1, double x2, double y2) {
            Assert.AreEqual(x2.Hypot2(y2), MathTool.Distance(x1, y1, x2, y2), 0.000000001d);

            var p1 = new PointF((float)x1, (float)y1);
            var p2 = new PointF((float)x2, (float)y2);

            Assert.AreEqual(x2.Hypot2(y2), p1.Distance(p2), 0.000000001d);
        }