/** @return the L2 distanse NOTE: 3D only!!! */ public double distance3D(Point p) { double temp = Math.pow(p.getX() - x, 2) + Math.pow(p.getY() - y, 2) + Math.pow(p.getZ() - z, 2); return Math.sqrt(temp); }
public static void exportTsin(DelaunayTriangulation dto, Writer writer) { PrintWriter os = new PrintWriter(writer); try { // prints the tsin file header: int len = dto.size(); os.println(len); Iterator<Point> it = dto.verticesIterator(); while (it.hasNext()) { Point p = it.next(); os.println(String.format("%s %s %s", p.getX(), p.getY(), p.getZ())); } } finally { Utils.closeQuietly(os); } }
/** * Create a bounding box between lowerLeft and upperRight * * @param lowerLeft * lower left point of the box * @param upperRight * upper left point of the box */ public BoundingBox(Point lowerLeft, Point upperRight) { init(lowerLeft.getX(), upperRight.getX(), lowerLeft.getY(), upperRight.getY(), lowerLeft.getZ(), upperRight.getZ()); }
public static Coord3d toJzyCoord(Point point) { return new Coord3d((float) point.getX(), (float)point.getY(), (float)point.getZ()); }
os.println(String.format("v %s %s %s", p.getX(), p.getY(), p.getZ()));
return a.getZ(); if (q.getX() == b.getX() && q.getY() == b.getY()) return b.getZ(); if (q.getX() == c.getX() && q.getY() == c.getY()) return c.getZ(); r = (x2 - X) / (x2 - x3); Z = b.getZ() + (c.getZ() - b.getZ()) * r; if (flag01 == 2) { r = (y1 - y0) / (y1 - Y); r = (x1 - x0) / (x1 - X); double qZ = a.getZ() + (Z - a.getZ()) * r; return qZ;
private void updateBoundingBox(Point p) { double x = p.getX(), y = p.getY(), z = p.getZ(); if (bbMin == null) { bbMin = new Point(p); bbMax = new Point(p); } else { if (x < bbMin.getX()) bbMin.setX(x); else if (x > bbMax.getX()) bbMax.setX(x); if (y < bbMin.getY()) bbMin.setY(y); else if (y > bbMax.getY()) bbMax.setY(y); if (z < bbMin.getZ()) bbMin.setZ(z); else if (z > bbMax.getZ()) bbMax.setZ(z); } }