mirror of https://github.com/CGAL/cgal
Use orientation with ORIGIN
This commit is contained in:
parent
ff15795882
commit
68a1fb4aad
|
|
@ -95,17 +95,20 @@ bool strictly_ordered_ccw_at(const Sphere_point<R>& p,
|
||||||
const Sphere_direction<R>& d2,
|
const Sphere_direction<R>& d2,
|
||||||
const Sphere_direction<R>& d3)
|
const Sphere_direction<R>& d3)
|
||||||
{ CGAL_assertion(d1.has_on(p) && d2.has_on(p) && d3.has_on(p));
|
{ CGAL_assertion(d1.has_on(p) && d2.has_on(p) && d3.has_on(p));
|
||||||
typename R::Point_3 p1(CGAL::ORIGIN + d1.orthogonal_vector());
|
typedef typename R::Vector_3 Vector_3;
|
||||||
typename R::Point_3 p2(CGAL::ORIGIN + d2.orthogonal_vector());
|
Vector_3 v0 = p - CGAL::ORIGIN;
|
||||||
typename R::Point_3 p3(CGAL::ORIGIN + d3.orthogonal_vector());
|
Vector_3 v1 = d1.orthogonal_vector();
|
||||||
|
Vector_3 v2 = d2.orthogonal_vector();
|
||||||
|
Vector_3 v3 = d3.orthogonal_vector();
|
||||||
|
|
||||||
if ( d1 == d3 ) return false;
|
if ( d1 == d3 ) return false;
|
||||||
if ( CGAL::orientation(CGAL::ORIGIN,p,p1,p3) == CGAL::POSITIVE ) {
|
typename R::Orientation_3 orientation = R().orientation_3_object();
|
||||||
return CGAL::orientation(CGAL::ORIGIN,p,p1,p2) == CGAL::POSITIVE &&
|
if ( orientation(v0,v1,v3) == CGAL::POSITIVE ) {
|
||||||
CGAL::orientation(CGAL::ORIGIN,p,p3,p2) == CGAL::NEGATIVE;
|
return orientation(v0,v1,v2) == CGAL::POSITIVE &&
|
||||||
|
orientation(v0,v3,v2) == CGAL::NEGATIVE;
|
||||||
} else {
|
} else {
|
||||||
return CGAL::orientation(CGAL::ORIGIN,p,p1,p2) == CGAL::POSITIVE ||
|
return orientation(v0,v1,v2) == CGAL::POSITIVE ||
|
||||||
CGAL::orientation(CGAL::ORIGIN,p,p3,p2) == CGAL::NEGATIVE;
|
orientation(v0,v3,v2) == CGAL::NEGATIVE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue