BWAPI
|
00001 // Copyright (c) 2000 Utrecht University (The Netherlands), 00002 // ETH Zurich (Switzerland), Freie Universitaet Berlin (Germany), 00003 // INRIA Sophia-Antipolis (France), Martin-Luther-University Halle-Wittenberg 00004 // (Germany), Max-Planck-Institute Saarbruecken (Germany), RISC Linz (Austria), 00005 // and Tel-Aviv University (Israel). All rights reserved. 00006 // 00007 // This file is part of CGAL (www.cgal.org); you can redistribute it and/or 00008 // modify it under the terms of the GNU Lesser General Public License as 00009 // published by the Free Software Foundation; version 2.1 of the License. 00010 // See the file LICENSE.LGPL distributed with CGAL. 00011 // 00012 // Licensees holding a valid commercial license may use this file in 00013 // accordance with the commercial license agreement provided with the software. 00014 // 00015 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00016 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00017 // 00018 // $URL: svn+ssh://scm.gforge.inria.fr/svn/cgal/branches/CGAL-3.5-branch/Cartesian_kernel/include/CGAL/predicates/kernel_ftC3.h $ 00019 // $Id: kernel_ftC3.h 47867 2009-02-02 13:09:25Z lrineau $ 00020 // 00021 // 00022 // Author(s) : Herve Bronnimann, Sylvain Pion 00023 00024 #ifndef CGAL_PREDICATES_KERNEL_FTC3_H 00025 #define CGAL_PREDICATES_KERNEL_FTC3_H 00026 00027 #include <CGAL/predicates/sign_of_determinant.h> 00028 #include <CGAL/predicates/kernel_ftC2.h> 00029 #include <CGAL/constructions/kernel_ftC3.h> 00030 00031 CGAL_BEGIN_NAMESPACE 00032 00033 template < class FT > 00034 inline 00035 typename Equal_to<FT>::result_type 00036 parallelC3(const FT &v1x, const FT &v1y, const FT &v1z, 00037 const FT &v2x, const FT &v2y, const FT &v2z) 00038 { 00039 return CGAL_AND_3( sign_of_determinant(v1x, v2x, v1y, v2y) == ZERO , 00040 sign_of_determinant(v1x, v2x, v1z, v2z) == ZERO , 00041 sign_of_determinant(v1y, v2y, v1z, v2z) == ZERO ); 00042 } 00043 00044 template < class FT > 00045 typename Equal_to<FT>::result_type 00046 parallelC3(const FT &s1sx, const FT &s1sy, const FT &s1sz, 00047 const FT &s1tx, const FT &s1ty, const FT &s1tz, 00048 const FT &s2sx, const FT &s2sy, const FT &s2sz, 00049 const FT &s2tx, const FT &s2ty, const FT &s2tz) 00050 { 00051 // NB : Could be made slightly more efficient by computing the z differences 00052 // only when they are needed. 00053 FT v1x = s1tx - s1sx; 00054 FT v1y = s1ty - s1sy; 00055 FT v1z = s1tz - s1sz; 00056 FT v2x = s2tx - s2sx; 00057 FT v2y = s2ty - s2sy; 00058 FT v2z = s2tz - s2sz; 00059 return parallelC3(v1x, v1y, v1z, v2x, v2y, v2z); 00060 } 00061 00062 template < class FT > 00063 CGAL_KERNEL_MEDIUM_INLINE 00064 typename Compare<FT>::result_type 00065 compare_lexicographically_xyzC3(const FT &px, const FT &py, const FT &pz, 00066 const FT &qx, const FT &qy, const FT &qz) 00067 { 00068 typedef typename Compare<FT>::result_type Cmp; 00069 Cmp c = CGAL_NTS compare(px, qx); 00070 if (c != EQUAL) return c; 00071 c = CGAL_NTS compare(py, qy); 00072 if (c != EQUAL) return c; 00073 return CGAL_NTS compare(pz, qz); 00074 } 00075 00076 template < class FT > 00077 CGAL_KERNEL_MEDIUM_INLINE 00078 typename Equal_to<FT>::result_type 00079 strict_dominanceC3(const FT &px, const FT &py, const FT &pz, 00080 const FT &qx, const FT &qy, const FT &qz) 00081 { 00082 return CGAL_AND_3( CGAL_NTS compare(px, qx) == LARGER , 00083 CGAL_NTS compare(py, qy) == LARGER , 00084 CGAL_NTS compare(pz, qz) == LARGER ); 00085 } 00086 00087 template < class FT > 00088 CGAL_KERNEL_MEDIUM_INLINE 00089 typename Equal_to<FT>::result_type 00090 dominanceC3(const FT &px, const FT &py, const FT &pz, 00091 const FT &qx, const FT &qy, const FT &qz) 00092 { 00093 return CGAL_AND_3( CGAL_NTS compare(px, qx) != SMALLER , 00094 CGAL_NTS compare(py, qy) != SMALLER , 00095 CGAL_NTS compare(pz, qz) != SMALLER ); 00096 } 00097 00098 template < class FT > 00099 CGAL_KERNEL_MEDIUM_INLINE 00100 typename Equal_to<FT>::result_type 00101 collinearC3(const FT &px, const FT &py, const FT &pz, 00102 const FT &qx, const FT &qy, const FT &qz, 00103 const FT &rx, const FT &ry, const FT &rz) 00104 { 00105 FT dpx = px-rx; 00106 FT dqx = qx-rx; 00107 FT dpy = py-ry; 00108 FT dqy = qy-ry; 00109 if (sign_of_determinant(dpx, dqx, dpy, dqy) != ZERO) 00110 return false; 00111 FT dpz = pz-rz; 00112 FT dqz = qz-rz; 00113 return CGAL_AND( sign_of_determinant(dpx, dqx, dpz, dqz) == ZERO , 00114 sign_of_determinant(dpy, dqy, dpz, dqz) == ZERO ); 00115 } 00116 00117 template < class FT > 00118 CGAL_KERNEL_MEDIUM_INLINE 00119 typename Same_uncertainty_nt<Orientation, FT>::type 00120 orientationC3(const FT &px, const FT &py, const FT &pz, 00121 const FT &qx, const FT &qy, const FT &qz, 00122 const FT &rx, const FT &ry, const FT &rz, 00123 const FT &sx, const FT &sy, const FT &sz) 00124 { 00125 return sign_of_determinant<FT>(qx-px,rx-px,sx-px, 00126 qy-py,ry-py,sy-py, 00127 qz-pz,rz-pz,sz-pz); 00128 } 00129 00130 template < class FT > 00131 CGAL_KERNEL_MEDIUM_INLINE 00132 typename Same_uncertainty_nt<Orientation, FT>::type 00133 orientationC3(const FT &ux, const FT &uy, const FT &uz, 00134 const FT &vx, const FT &vy, const FT &vz, 00135 const FT &wx, const FT &wy, const FT &wz) 00136 { 00137 return sign_of_determinant(ux, vx, wx, 00138 uy, vy, wy, 00139 uz, vz, wz); 00140 } 00141 00142 template < class FT > 00143 inline 00144 typename Same_uncertainty_nt<Angle, FT>::type 00145 angleC3(const FT &px, const FT &py, const FT &pz, 00146 const FT &qx, const FT &qy, const FT &qz, 00147 const FT &rx, const FT &ry, const FT &rz) 00148 { 00149 return enum_cast<Angle>(CGAL_NTS sign((px-qx)*(rx-qx)+ 00150 (py-qy)*(ry-qy)+ 00151 (pz-qz)*(rz-qz))); 00152 } 00153 00154 template < class FT > 00155 CGAL_KERNEL_MEDIUM_INLINE 00156 typename Same_uncertainty_nt<Orientation, FT>::type 00157 coplanar_orientationC3(const FT &px, const FT &py, const FT &pz, 00158 const FT &qx, const FT &qy, const FT &qz, 00159 const FT &rx, const FT &ry, const FT &rz, 00160 const FT &sx, const FT &sy, const FT &sz) 00161 { 00162 typedef typename Same_uncertainty_nt<Orientation, FT>::type Ori; 00163 Ori oxy_pqr = orientationC2(px,py,qx,qy,rx,ry); 00164 if (oxy_pqr != COLLINEAR) 00165 return oxy_pqr * orientationC2(px,py,qx,qy,sx,sy); 00166 00167 Ori oyz_pqr = orientationC2(py,pz,qy,qz,ry,rz); 00168 if (oyz_pqr != COLLINEAR) 00169 return oyz_pqr * orientationC2(py,pz,qy,qz,sy,sz); 00170 00171 Ori oxz_pqr = orientationC2(px,pz,qx,qz,rx,rz); 00172 CGAL_kernel_assertion(oxz_pqr != COLLINEAR); 00173 return oxz_pqr * orientationC2(px,pz,qx,qz,sx,sz); 00174 } 00175 00176 template < class FT > 00177 CGAL_KERNEL_MEDIUM_INLINE 00178 typename Same_uncertainty_nt<Orientation, FT>::type 00179 coplanar_orientationC3(const FT &px, const FT &py, const FT &pz, 00180 const FT &qx, const FT &qy, const FT &qz, 00181 const FT &rx, const FT &ry, const FT &rz) 00182 { 00183 typedef typename Same_uncertainty_nt<Orientation, FT>::type Ori; 00184 Ori oxy_pqr = orientationC2(px,py,qx,qy,rx,ry); 00185 if (oxy_pqr != COLLINEAR) 00186 return oxy_pqr; 00187 00188 Ori oyz_pqr = orientationC2(py,pz,qy,qz,ry,rz); 00189 if (oyz_pqr != COLLINEAR) 00190 return oyz_pqr; 00191 00192 return orientationC2(px,pz,qx,qz,rx,rz); 00193 } 00194 00195 template < class FT > 00196 CGAL_KERNEL_LARGE_INLINE 00197 typename Same_uncertainty_nt<Bounded_side, FT>::type 00198 coplanar_side_of_bounded_circleC3(const FT &px, const FT &py, const FT &pz, 00199 const FT &qx, const FT &qy, const FT &qz, 00200 const FT &rx, const FT &ry, const FT &rz, 00201 const FT &tx, const FT &ty, const FT &tz) 00202 { 00203 // The approach is to compute side_of_bounded_sphere(p,q,r,t+v,t), 00204 // with v = pq ^ pr. 00205 // Note : since the circle defines the orientation of the plane, it can not 00206 // be considered oriented. 00207 FT ptx = px - tx; 00208 FT pty = py - ty; 00209 FT ptz = pz - tz; 00210 FT pt2 = CGAL_NTS square(ptx) + CGAL_NTS square(pty) + CGAL_NTS square(ptz); 00211 FT qtx = qx - tx; 00212 FT qty = qy - ty; 00213 FT qtz = qz - tz; 00214 FT qt2 = CGAL_NTS square(qtx) + CGAL_NTS square(qty) + CGAL_NTS square(qtz); 00215 FT rtx = rx - tx; 00216 FT rty = ry - ty; 00217 FT rtz = rz - tz; 00218 FT rt2 = CGAL_NTS square(rtx) + CGAL_NTS square(rty) + CGAL_NTS square(rtz); 00219 FT pqx = qx - px; 00220 FT pqy = qy - py; 00221 FT pqz = qz - pz; 00222 FT prx = rx - px; 00223 FT pry = ry - py; 00224 FT prz = rz - pz; 00225 FT vx = pqy*prz - pqz*pry; 00226 FT vy = pqz*prx - pqx*prz; 00227 FT vz = pqx*pry - pqy*prx; 00228 FT v2 = CGAL_NTS square(vx) + CGAL_NTS square(vy) + CGAL_NTS square(vz); 00229 return enum_cast<Bounded_side>(sign_of_determinant(ptx,pty,ptz,pt2, 00230 rtx,rty,rtz,rt2, 00231 qtx,qty,qtz,qt2, 00232 vx,vy,vz,v2)); 00233 } 00234 00235 template < class FT > 00236 CGAL_KERNEL_MEDIUM_INLINE 00237 typename Equal_to<FT>::result_type 00238 collinear_are_ordered_along_lineC3( 00239 const FT &px, const FT &py, const FT &pz, 00240 const FT &qx, const FT &qy, const FT &qz, 00241 const FT &rx, const FT &ry, const FT &rz) 00242 { 00243 if (px < qx) return !(rx < qx); 00244 if (qx < px) return !(qx < rx); 00245 if (py < qy) return !(ry < qy); 00246 if (qy < py) return !(qy < ry); 00247 if (pz < qz) return !(rz < qz); 00248 if (qz < pz) return !(qz < rz); 00249 return true; // p==q 00250 } 00251 00252 template < class FT > 00253 CGAL_KERNEL_MEDIUM_INLINE 00254 typename Equal_to<FT>::result_type 00255 collinear_are_strictly_ordered_along_lineC3( 00256 const FT &px, const FT &py, const FT &pz, 00257 const FT &qx, const FT &qy, const FT &qz, 00258 const FT &rx, const FT &ry, const FT &rz) 00259 { 00260 if (px < qx) return (qx < rx); 00261 if (qx < px) return (rx < qx); 00262 if (py < qy) return (qy < ry); 00263 if (qy < py) return (ry < qy); 00264 if (pz < qz) return (qz < rz); 00265 if (qz < pz) return (rz < qz); 00266 return false; // p==q 00267 } 00268 00269 template < class FT > 00270 CGAL_KERNEL_MEDIUM_INLINE 00271 typename Equal_to<FT>::result_type 00272 equal_directionC3(const FT &dx1, const FT &dy1, const FT &dz1, 00273 const FT &dx2, const FT &dy2, const FT &dz2) 00274 { 00275 return sign_of_determinant(dx1, dy1, dx2, dy2) == ZERO 00276 && sign_of_determinant(dx1, dz1, dx2, dz2) == ZERO 00277 && sign_of_determinant(dy1, dz1, dy2, dz2) == ZERO 00278 && CGAL_NTS sign(dx1) == CGAL_NTS sign(dx2) 00279 && CGAL_NTS sign(dy1) == CGAL_NTS sign(dy2) 00280 && CGAL_NTS sign(dz1) == CGAL_NTS sign(dz2); 00281 } 00282 00283 template < class FT > 00284 CGAL_KERNEL_MEDIUM_INLINE 00285 typename Equal_to<FT>::result_type 00286 equal_planeC3(const FT &ha, const FT &hb, const FT &hc, const FT &hd, 00287 const FT &pa, const FT &pb, const FT &pc, const FT &pd) 00288 { 00289 typedef typename Sgn<FT>::result_type Sg; 00290 00291 if (!equal_directionC3(ha, hb, hc, pa, pb, pc)) 00292 return false; // Not parallel. 00293 00294 Sg s1a = CGAL_NTS sign(ha); 00295 if (s1a != ZERO) 00296 return CGAL_AND( s1a == CGAL_NTS sign(pa) , 00297 sign_of_determinant(pa, pd, ha, hd) == ZERO ); 00298 Sg s1b = CGAL_NTS sign(hb); 00299 if (s1b != ZERO) 00300 return s1b == CGAL_NTS sign(pb) 00301 && sign_of_determinant(pb, pd, hb, hd) == ZERO; 00302 return CGAL_NTS sign(pc) == CGAL_NTS sign(hc) 00303 && sign_of_determinant(pc, pd, hc, hd) == ZERO; 00304 } 00305 00306 template <class FT > 00307 CGAL_KERNEL_LARGE_INLINE 00308 typename Same_uncertainty_nt<Oriented_side, FT>::type 00309 side_of_oriented_planeC3(const FT &a, const FT &b, const FT &c, const FT &d, 00310 const FT &px, const FT &py, const FT &pz) 00311 { 00312 return CGAL_NTS sign(a*px + b*py + c*pz + d); 00313 } 00314 00315 template <class FT > 00316 CGAL_KERNEL_LARGE_INLINE 00317 typename Same_uncertainty_nt<Oriented_side, FT>::type 00318 side_of_oriented_sphereC3(const FT &px, const FT &py, const FT &pz, 00319 const FT &qx, const FT &qy, const FT &qz, 00320 const FT &rx, const FT &ry, const FT &rz, 00321 const FT &sx, const FT &sy, const FT &sz, 00322 const FT &tx, const FT &ty, const FT &tz) 00323 { 00324 FT ptx = px - tx; 00325 FT pty = py - ty; 00326 FT ptz = pz - tz; 00327 FT pt2 = CGAL_NTS square(ptx) + CGAL_NTS square(pty) + CGAL_NTS square(ptz); 00328 FT qtx = qx - tx; 00329 FT qty = qy - ty; 00330 FT qtz = qz - tz; 00331 FT qt2 = CGAL_NTS square(qtx) + CGAL_NTS square(qty) + CGAL_NTS square(qtz); 00332 FT rtx = rx - tx; 00333 FT rty = ry - ty; 00334 FT rtz = rz - tz; 00335 FT rt2 = CGAL_NTS square(rtx) + CGAL_NTS square(rty) + CGAL_NTS square(rtz); 00336 FT stx = sx - tx; 00337 FT sty = sy - ty; 00338 FT stz = sz - tz; 00339 FT st2 = CGAL_NTS square(stx) + CGAL_NTS square(sty) + CGAL_NTS square(stz); 00340 return sign_of_determinant(ptx,pty,ptz,pt2, 00341 rtx,rty,rtz,rt2, 00342 qtx,qty,qtz,qt2, 00343 stx,sty,stz,st2); 00344 // Note that the determinant above is det(P,R,Q,S) (Q and R are swapped)! 00345 } 00346 00347 template <class FT > 00348 CGAL_KERNEL_MEDIUM_INLINE 00349 typename Same_uncertainty_nt<Bounded_side, FT>::type 00350 side_of_bounded_sphereC3(const FT &px, const FT &py, const FT &pz, 00351 const FT &qx, const FT &qy, const FT &qz, 00352 const FT &rx, const FT &ry, const FT &rz, 00353 const FT &sx, const FT &sy, const FT &sz, 00354 const FT &tx, const FT &ty, const FT &tz) 00355 { 00356 return enum_cast<Bounded_side>( side_of_oriented_sphereC3(px, py, pz, 00357 qx, qy, qz, 00358 rx, ry, rz, 00359 sx, sy, sz, 00360 tx, ty, tz) 00361 * orientationC3(px, py, pz, 00362 qx, qy, qz, 00363 rx, ry, rz, 00364 sx, sy, sz) ); 00365 } 00366 00367 template <class FT > 00368 CGAL_KERNEL_MEDIUM_INLINE 00369 typename Same_uncertainty_nt<Bounded_side, FT>::type 00370 side_of_bounded_sphereC3(const FT &px, const FT &py, const FT &pz, 00371 const FT &qx, const FT &qy, const FT &qz, 00372 const FT &tx, const FT &ty, const FT &tz) 00373 { 00374 // Returns whether T lies inside or outside the sphere which diameter is PQ. 00375 return enum_cast<Bounded_side>( CGAL_NTS sign((tx-px)*(qx-tx) 00376 + (ty-py)*(qy-ty) 00377 + (tz-pz)*(qz-tz)) ); 00378 } 00379 00380 template < class FT > 00381 CGAL_KERNEL_INLINE 00382 typename Compare<FT>::result_type 00383 cmp_dist_to_pointC3(const FT &px, const FT &py, const FT &pz, 00384 const FT &qx, const FT &qy, const FT &qz, 00385 const FT &rx, const FT &ry, const FT &rz) 00386 { 00387 return CGAL_NTS compare(squared_distanceC3(px,py,pz,qx,qy,qz), 00388 squared_distanceC3(px,py,pz,rx,ry,rz)); 00389 } 00390 00391 // Because of the way the filtered predicates generator script works, 00392 // cmp_dist_to_pointC3() must be defined _before_ ths following one. 00393 template <class FT > 00394 CGAL_KERNEL_MEDIUM_INLINE 00395 typename Same_uncertainty_nt<Bounded_side, FT>::type 00396 side_of_bounded_sphereC3(const FT &px, const FT &py, const FT &pz, 00397 const FT &qx, const FT &qy, const FT &qz, 00398 const FT &sx, const FT &sy, const FT &sz, 00399 const FT &tx, const FT &ty, const FT &tz) 00400 { 00401 // Returns whether T lies inside or outside the sphere which equatorial 00402 // circle is PQR. 00403 00404 // This code is inspired by the one of circumcenterC3(3 points). 00405 00406 FT psx = px-sx; 00407 FT psy = py-sy; 00408 FT psz = pz-sz; 00409 FT ps2 = CGAL_NTS square(psx) + CGAL_NTS square(psy) + CGAL_NTS square(psz); 00410 FT qsx = qx-sx; 00411 FT qsy = qy-sy; 00412 FT qsz = qz-sz; 00413 FT qs2 = CGAL_NTS square(qsx) + CGAL_NTS square(qsy) + CGAL_NTS square(qsz); 00414 FT rsx = psy*qsz-psz*qsy; 00415 FT rsy = psz*qsx-psx*qsz; 00416 FT rsz = psx*qsy-psy*qsx; 00417 FT tsx = tx-sx; 00418 FT tsy = ty-sy; 00419 FT tsz = tz-sz; 00420 00421 FT num_x = ps2 * determinant(qsy,qsz,rsy,rsz) 00422 - qs2 * determinant(psy,psz,rsy,rsz); 00423 FT num_y = ps2 * determinant(qsx,qsz,rsx,rsz) 00424 - qs2 * determinant(psx,psz,rsx,rsz); 00425 FT num_z = ps2 * determinant(qsx,qsy,rsx,rsy) 00426 - qs2 * determinant(psx,psy,rsx,rsy); 00427 00428 FT den2 = 2 * determinant(psx,psy,psz, 00429 qsx,qsy,qsz, 00430 rsx,rsy,rsz); 00431 00432 // The following could be simplified a bit. 00433 return enum_cast<Bounded_side>( 00434 cmp_dist_to_pointC3<FT>(num_x, - num_y, num_z, 00435 psx*den2, psy*den2, psz*den2, 00436 tsx*den2, tsy*den2, tsz*den2) ); 00437 } 00438 00439 template < class FT > 00440 CGAL_KERNEL_MEDIUM_INLINE 00441 typename Equal_to<FT>::result_type 00442 has_larger_dist_to_pointC3(const FT &px, const FT &py, const FT &pz, 00443 const FT &qx, const FT &qy, const FT &qz, 00444 const FT &rx, const FT &ry, const FT &rz) 00445 { 00446 return cmp_dist_to_pointC3(px,py,pz,qx,qy,qz,rx,ry,rz) == LARGER; 00447 } 00448 00449 template < class FT > 00450 CGAL_KERNEL_MEDIUM_INLINE 00451 typename Equal_to<FT>::result_type 00452 has_smaller_dist_to_pointC3(const FT &px, const FT &py, const FT &pz, 00453 const FT &qx, const FT &qy, const FT &qz, 00454 const FT &rx, const FT &ry, const FT &rz) 00455 { 00456 return cmp_dist_to_pointC3(px,py,pz,qx,qy,qz,rx,ry,rz) == SMALLER; 00457 } 00458 00459 template < class FT > 00460 CGAL_KERNEL_MEDIUM_INLINE 00461 typename Compare<FT>::result_type 00462 cmp_signed_dist_to_directionC3( const FT &pa, const FT &pb, const FT &pc, 00463 const FT &px, const FT &py, const FT &pz, 00464 const FT &qx, const FT &qy, const FT &qz) 00465 { 00466 return CGAL_NTS compare(scaled_distance_to_directionC3(pa,pb,pc,px,py,pz), 00467 scaled_distance_to_directionC3(pa,pb,pc,qx,qy,qz)); 00468 } 00469 00470 template < class FT > 00471 CGAL_KERNEL_MEDIUM_INLINE 00472 typename Equal_to<FT>::result_type 00473 has_larger_signed_dist_to_directionC3( 00474 const FT &pa, const FT &pb, const FT &pc, 00475 const FT &px, const FT &py, const FT &pz, 00476 const FT &qx, const FT &qy, const FT &qz) 00477 { 00478 return cmp_signed_dist_to_directionC3(pa,pb,pc,px,py,pz,qx,qy,qz) == LARGER; 00479 } 00480 00481 template < class FT > 00482 CGAL_KERNEL_MEDIUM_INLINE 00483 typename Equal_to<FT>::result_type 00484 has_smaller_signed_dist_to_directionC3( 00485 const FT &pa, const FT &pb, const FT &pc, 00486 const FT &px, const FT &py, const FT &pz, 00487 const FT &qx, const FT &qy, const FT &qz) 00488 { 00489 return cmp_signed_dist_to_directionC3(pa,pb,pc,px,py,pz,qx,qy,qz) == SMALLER; 00490 } 00491 00492 template < class FT > 00493 CGAL_KERNEL_MEDIUM_INLINE 00494 typename Compare<FT>::result_type 00495 cmp_signed_dist_to_planeC3( 00496 const FT &ppx, const FT &ppy, const FT &ppz, 00497 const FT &pqx, const FT &pqy, const FT &pqz, 00498 const FT &prx, const FT &pry, const FT &prz, 00499 const FT &px, const FT &py, const FT &pz, 00500 const FT &qx, const FT &qy, const FT &qz) 00501 { 00502 return sign_of_determinant<FT>( pqx-ppx, pqy-ppy, pqz-ppz, 00503 prx-ppx, pry-ppy, prz-ppz, 00504 px-qx, py-qy, pz-qz); 00505 } 00506 00507 template < class FT > 00508 CGAL_KERNEL_MEDIUM_INLINE 00509 typename Equal_to<FT>::result_type 00510 has_larger_signed_dist_to_planeC3( 00511 const FT &ppx, const FT &ppy, const FT &ppz, 00512 const FT &pqx, const FT &pqy, const FT &pqz, 00513 const FT &prx, const FT &pry, const FT &prz, 00514 const FT &px, const FT &py, const FT &pz, 00515 const FT &qx, const FT &qy, const FT &qz) 00516 { 00517 return cmp_signed_dist_to_planeC3(ppx, ppy, ppz, pqx, pqy, pqz, 00518 prx, pry, prz, px, py, pz, qx, qy, qz) == LARGER; 00519 } 00520 00521 template < class FT > 00522 CGAL_KERNEL_MEDIUM_INLINE 00523 typename Equal_to<FT>::result_type 00524 has_smaller_signed_dist_to_planeC3( 00525 const FT &ppx, const FT &ppy, const FT &ppz, 00526 const FT &pqx, const FT &pqy, const FT &pqz, 00527 const FT &prx, const FT &pry, const FT &prz, 00528 const FT &px, const FT &py, const FT &pz, 00529 const FT &qx, const FT &qy, const FT &qz) 00530 { 00531 return cmp_signed_dist_to_planeC3(ppx, ppy, ppz, pqx, pqy, pqz, 00532 prx, pry, prz, px, py, pz, qx, qy, qz) == SMALLER; 00533 } 00534 00535 CGAL_END_NAMESPACE 00536 00537 #endif // CGAL_PREDICATES_KERNEL_FTC3_H