Exemple #1
0
        private double PerpendicularSquared(Node x, Point2D p, bool isVertical)
        {
            Point2D q = isVertical ? new Point2D(x.p.X, p.Y) : new Point2D(p.X, x.p.Y);

            return(p.DistanceSquaredTo(q));
        }
Exemple #2
0
 public bool Contains(Point2D p)
 {
     return(FindRecursive(root, p, true) != null);
 }
Exemple #3
0
 public bool contains(Point2D p)
 {
     return((p.X >= Xmin) && (p.X <= Xmax) && (p.Y >= Ymin) && (p.Y <= Ymax));
 }
Exemple #4
0
 public void Insert(Point2D p)
 {
     root = InsertRecursive(root, p, true, 0.0, 0.0, 1.0, 1.0);
 }
Exemple #5
0
 public double distanceTo(Point2D p)
 {
     return(Math.Sqrt(this.distanceSquaredTo(p)));
 }