/** * Computes the center of 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 po array containing (x,y,z) coordinates of center. */ public static void centerSphere( double[] pa, double[] pb, double[] pc, double[] pd, double[] po) { centerSphere(pa[0],pa[1],pa[2], pb[0],pb[1],pb[2], pc[0],pc[1],pc[2], pd[0],pd[1],pd[2], po); }
/** * Computes the center of 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 po array containing (x,y,z) coordinates of center. */ public static void centerSphere( float[] pa, float[] pb, float[] pc, float[] pd, float[] po) { centerSphere(pa[0],pa[1],pa[2], pb[0],pb[1],pb[2], pc[0],pc[1],pc[2], pd[0],pd[1],pd[2], po); }
double y3 = _n3._y; double z3 = _n3._z; Geometry.centerSphere(x0,y0,z0,x1,y1,z1,x2,y2,z2,x3,y3,z3,c); setCenter(c[0],c[1],c[2]);
double z3 = n3._z; double[] po = new double[3]; Geometry.centerSphere(x0,y0,z0,x1,y1,z1,x2,y2,z2,x3,y3,z3,po); double xo = po[0]; double yo = po[1];
double xc = nc.xp(), yc = nc.yp(), zc = nc.zp(); double xd = nd.xp(), yd = nd.yp(), zd = nd.zp(); Geometry.centerSphere(xp,yp,zp,xb,yb,zb,xc,yc,zc,xd,yd,zd,_ca); Geometry.centerSphere(xp,yp,zp,xa,ya,za,xd,yd,zd,xc,yc,zc,_cb); Geometry.centerSphere(xp,yp,zp,xa,ya,za,xb,yb,zb,xd,yd,zd,_cc); Geometry.centerSphere(xp,yp,zp,xa,ya,za,xc,yc,zc,xb,yb,zb,_cd); Geometry.centerSphere(xa,ya,za,xb,yb,zb,xc,yc,zc,xd,yd,zd,_ct); double va = volume(_cb,_cc,_cd,_ct); double vb = volume(_ca,_cd,_cc,_ct);
private void addFace( double xp, double yp, double zp, double xr, double yr, double zr, TetMesh.Node na, TetMesh.Node nb, TetMesh.Node nc) { 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(); Geometry.centerSphere(xp,yp,zp,xa,ya,za,xb,yb,zb,xc,yc,zc,_xyz); double xf = _xyz[0]-xp, yf = _xyz[1]-yp, zf = _xyz[2]-zp; _faceList.add(na,nb,nc,xf,yf,zf,xr,yr,zr); }