/** * compute the Z value for the X,Y values of q. assume this triangle * represent a plane --> q does NOT need to be contained in this triangle. * * @param x * x-coordinate of the query point. * @param y * y-coordinate of the query point. * @return z (height) value approximation given by the triangle it falls in. * */ public double getZ(double x, double y) { return zValue(new Point(x, y)); }
/** * * @param x * - X cordination of the query point * @param y * - Y cordination of the query point * @return the q point with updated Z value (z value is as given the * triangulation). */ public double z(double x, double y) { Point q = new Point(x, y); Triangle t = find(q); return t.zValue(q); }
/** * compute the Z value for the X,Y values of q. assume this triangle * represent a plane --> q does NOT need to be contained in this triangle. * * @param q * query point (its Z value is ignored). * @return q with updated Z value. * */ public Point getZ(Point q) { double z = zValue(q); return new Point(q.getX(), q.getY(), z); }