46 double dd,ux,uy,uz,n1[3],n2[3],n3[3],*c1,*c2,*c3,*c4,pl1,pl2,pl3;
58 dd = ux*ux + uy*uy + uz*uz;
68 pl1 = n1[0]*(c4[0]+c1[0]) \
69 + n1[1]*(c4[1]+c1[1]) + n1[2]*(c4[2]+c1[2]);
75 dd = ux*ux + uy*uy + uz*uz;
83 pl2 = n2[0]*(c4[0]+c2[0]) \
84 + n2[1]*(c4[1]+c2[1]) + n2[2]*(c4[2]+c2[2]);
90 dd = ux*ux + uy*uy + uz*uz;
98 pl3 = n3[0]*(c4[0]+c3[0]) \
99 + n3[1]*(c4[1]+c3[1]) + n3[2]*(c4[2]+c3[2]);
102 ux = n2[1]*n3[2] - n2[2]*n3[1];
103 uy = n1[2]*n3[1] - n1[1]*n3[2];
104 uz = n1[1]*n2[2] - n1[2]*n2[1];
106 dd = n1[0]*ux + n2[0]*uy + n3[0]*uz;
107 if(fabs((dd))<1e-12)
return 0;
110 cc1 = ux*pl1 + uy*pl2 + uz*pl3;
111 cc2 = pl1 * (n2[2]*n3[0] - n2[0]*n3[2]) \
112 + pl2 * (n1[0]*n3[2] - n3[0]*n1[2]) \
113 + pl3 * (n2[0]*n1[2] - n2[2]*n1[0]);
114 cc3 = pl1 * (n2[0]*n3[1] - n2[1]*n3[0]) \
115 + pl2 * (n3[0]*n1[1] - n3[1]*n1[0]) \
116 + pl3 * (n1[0]*n2[1] - n2[0]*n1[1]);
123 *rad = (c[0] - c4[0]) * (c[0] - c4[0]) \
124 + (c[1] - c4[1]) * (c[1] - c4[1]) \
125 + (c[2] - c4[2]) * (c[2] - c4[2]);
143 double d1,d2,d3,det,dd,ux,uy,uz,vx,vy,vz,wx,wy,wz;
144 double ax,ay,az,bx,by,bz,cx,cy,cz;
147 dd = m[0]*ct[0]*ct[0] + m[3]*ct[1]*ct[1] + m[5]*ct[2]*ct[2] \
148 + 2.0*(m[1]*ct[0]*ct[1] + m[2]*ct[0]*ct[2] + m[4]*ct[1]*ct[2]);
151 d1 = m[0]*ct[3]*ct[3] + m[3]*ct[4]*ct[4] + m[5]*ct[5]*ct[5] \
152 + 2.0*(m[1]*ct[3]*ct[4] + m[2]*ct[3]*ct[5] + m[4]*ct[4]*ct[5]) - dd;
154 d2 = m[0]*ct[6]*ct[6] + m[3]*ct[7]*ct[7] + m[5]*ct[8]*ct[8] \
155 + 2.0*(m[1]*ct[6]*ct[7] + m[2]*ct[6]*ct[8] + m[4]*ct[7]*ct[8]) - dd;
157 d3 = m[0]*ct[9]*ct[9] + m[3]*ct[10]*ct[10] + m[5]*ct[11]*ct[11] \
158 + 2.0*(m[1]*ct[9]*ct[10] + m[2]*ct[9]*ct[11] + m[4]*ct[10]*ct[11]) - dd;
173 ax = m[0]*ux + m[1]*uy + m[2]*uz;
174 ay = m[1]*ux + m[3]*uy + m[4]*uz;
175 az = m[2]*ux + m[4]*uy + m[5]*uz;
177 bx = m[0]*vx + m[1]*vy + m[2]*vz;
178 by = m[1]*vx + m[3]*vy + m[4]*vz;
179 bz = m[2]*vx + m[4]*vy + m[5]*vz;
181 cx = m[0]*wx + m[1]*wy + m[2]*wz;
182 cy = m[1]*wx + m[3]*wy + m[4]*wz;
183 cz = m[2]*wx + m[4]*wy + m[5]*wz;
186 c[0] = d1 *(by*cz - bz*cy) - d2 * (ay*cz - az*cy) + d3 * (ay*bz - az*by);
187 c[1] = d1 *(bz*cx - bx*cz) - d2 * (az*cx - ax*cz) + d3 * (az*bx - ax*bz);
188 c[2] = d1 *(bx*cy - by*cx) - d2 * (ax*cy - ay*cx) + d3 * (ax*by - ay*bx);
190 det = ax * (by*cz - bz*cy) - ay * (bx*cz - bz*cx) + az * (bx*cy - cx*by);
191 det = 1.0 / (2.0*det);
201 *rad = m[0]*ux*ux + m[3]*uy*uy + m[5]*uz*uz \
202 + 2.0*(m[1]*ux*uy + m[2]*ux*uz + m[4]*uy*uz);
int MMG5_cenrad_iso(MMG5_pMesh mesh, double *ct, double *c, double *rad)
int MMG5_cenrad_ani(MMG5_pMesh mesh, double *ct, double *m, double *c, double *rad)