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)); }
public bool Contains(Point2D p) { return(FindRecursive(root, p, true) != null); }
public bool contains(Point2D p) { return((p.X >= Xmin) && (p.X <= Xmax) && (p.Y >= Ymin) && (p.Y <= Ymax)); }
public void Insert(Point2D p) { root = InsertRecursive(root, p, true, 0.0, 0.0, 1.0, 1.0); }
public double distanceTo(Point2D p) { return(Math.Sqrt(this.distanceSquaredTo(p))); }