/** * Returns true iff node n is in circumsphere of tet abcd. * Perturbation of coordinates ensures that the node is not on the sphere. */ private static boolean inSphere( Node a, Node b, Node c, Node d, Node n) { return Geometry.inSphere( a._x,a._y,a._z, b._x,b._y,b._z, c._x,c._y,c._z, d._x,d._y,d._z, n._x,n._y,n._z)>0.0; }
ra = Geometry.inSphere(pa,pb,pc,pd,pe); rf = Geometry.inSphereFast(pa,pb,pc,pd,pe); trace("0 inSphere: "+String.format("%26.18e",ra)); ra = Geometry.inSphere(pa,pb,pc,pd,pe); rf = Geometry.inSphereFast(pa,pb,pc,pd,pe); trace("+ inSphere: "+String.format("%26.18e",ra)); ra = Geometry.inSphere(pa,pb,pc,pd,pe); rf = Geometry.inSphereFast(pa,pb,pc,pd,pe); trace("- inSphere: "+String.format("%26.18e",ra));
for (nsphere=0; sw.time()<maxtime; nsphere+=niter) { for (int iter=0; iter<niter; ++iter) { Geometry.inSphere(xa,ya,za,xb,yb,zb,xc,yc,zc,xd,yd,zd,xe,ye,ze);
/** * Returns true iff point (x,y,z) is in circumsphere of tet abcd. * (Currently unused.) */ private static boolean inSphere( Node a, Node b, Node c, Node d, double x, double y, double z) { return Geometry.inSphere( a._x,a._y,a._z, b._x,b._y,b._z, c._x,c._y,c._z, d._x,d._y,d._z, x,y,z)>0.0; }
/** * Determines if a point e is inside the sphere defined by the points * a, b, c, and d. The latter are assumed to be in CCW order, such that * the method {@link #leftOfPlane} would return a positive number. * @param pa {x,y,z} coordinates of point a. * @param pb {x,y,z} coordinates of point b. * @param pc {x,y,z} coordinates of point c. * @param pd {x,y,z} coordinates of point d. * @param pe {x,y,z} coordinates of point e. * @return positive, if inside the sphere; * negative, if outside the sphere; * zero, otherwise. */ public static double inSphere( double[] pa, double[] pb, double[] pc, double[] pd, double[] pe) { return inSphere( pa[0],pa[1],pa[2], pb[0],pb[1],pb[2], pc[0],pc[1],pc[2], pd[0],pd[1],pd[2], pe[0],pe[1],pe[2]); }
/** * Determines if a point e is inside the sphere defined by the points * a, b, c, and d. The latter are assumed to be in CCW order, such that * the method {@link #leftOfPlane} would return a positive number. * @param pa {x,y,z} coordinates of point a. * @param pb {x,y,z} coordinates of point b. * @param pc {x,y,z} coordinates of point c. * @param pd {x,y,z} coordinates of point d. * @param pe {x,y,z} coordinates of point e. * @return positive, if inside the sphere; * negative, if outside the sphere; * zero, otherwise. */ public static double inSphere( float[] pa, float[] pb, float[] pc, float[] pd, float[] pe) { return inSphere( pa[0],pa[1],pa[2], pb[0],pb[1],pb[2], pc[0],pc[1],pc[2], pd[0],pd[1],pd[2], pe[0],pe[1],pe[2]); }
private boolean needTet(double xp, double yp, double zp, TetMesh.Tet tet) { if (tet==null || _mesh.isMarked(tet)) return false; TetMesh.Node na = tet.nodeA(); TetMesh.Node nb = tet.nodeB(); TetMesh.Node nc = tet.nodeC(); TetMesh.Node nd = tet.nodeD(); double xa = na.xp(), ya = na.yp(), za = na.zp(); double xb = nb.xp(), yb = nb.yp(), zb = nb.zp(); double xc = nc.xp(), yc = nc.yp(), zc = nc.zp(); double xd = nd.xp(), yd = nd.yp(), zd = nd.zp(); return Geometry.inSphere(xa,ya,za,xb,yb,zb,xc,yc,zc,xd,yd,zd,xp,yp,zp)>0.0; }