Class ApproximatePredicates_2
java.lang.Object
Jcg.geometry.kernel.ApproximatePredicates_2
- All Implemented Interfaces:
GeometricPredicates_2
Approximate geometric predicates for plane objects (points, segments, rays)
- Version:
- dec 2012
- Author:
- Luca Castelli Aleardi and Steve Oudot (INF562, Ecole Polytechnique)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if a, b and c lie on a same linebooleandoIntersect(Segment_2 s, Ray_2 r) Returns true if segment s and ray r intersectbooleandoIntersect(Segment_2 s, Segment_2 t) Returns true if segments 's' and 't' intersectbooleanTests if point p lies inside the circumcircle of triangle a,b,cbooleanisClockwise(Point_2 a, Point_2 b, Point_2 c) Returns true if a, b and c turn in clockwise directionbooleanisCounterClockwise(Point_2 a, Point_2 b, Point_2 c) Returns true if a, b and c turn in counter-clockwise directionbooleanReturns true if point p lies on segment abintorientation(Point_2 a, Point_2 b, Point_2 c) Returns the orientation of a, b and c
-
Constructor Details
-
ApproximatePredicates_2
public ApproximatePredicates_2()
-
-
Method Details
-
orientation
Returns the orientation of a, b and c- Specified by:
orientationin interfaceGeometricPredicates_2- Parameters:
a- ,b,c the 3 points to test- Returns:
- 1 if sequence (a, b, c) turns in counter-clockwise direction, -1 if it turns in clockwise direction, 0 if the points are collinear
-
isCounterClockwise
Returns true if a, b and c turn in counter-clockwise direction- Specified by:
isCounterClockwisein interfaceGeometricPredicates_2- Parameters:
a- ,b,c the 3 points to test- Returns:
- true if a, b and c turn in counter-clockwise direction.
Warning: the result is false if the three points are collinear
-
isClockwise
Returns true if a, b and c turn in clockwise direction- Specified by:
isClockwisein interfaceGeometricPredicates_2- Parameters:
a- ,b,c the 3 points to test- Returns:
- true if a, b and c turn in clockwise direction.
Warning: the result is false if the three points are collinear
-
collinear
Returns true if a, b and c lie on a same line- Specified by:
collinearin interfaceGeometricPredicates_2- Parameters:
a- ,b,c the 3 points to test- Returns:
- true if a, b and c are collinear (lie on a same line)
-
inCircle
-
doIntersect
Returns true if segments 's' and 't' intersect- Specified by:
doIntersectin interfaceGeometricPredicates_2- Parameters:
s- first segmentt- second segment- Returns:
- true if s and t intersect each other
-
doIntersect
Returns true if segment s and ray r intersect- Specified by:
doIntersectin interfaceGeometricPredicates_2- Parameters:
s- the segmentr- the ray- Returns:
- true if s intersects r
-
liesOn
Returns true if point p lies on segment ab- Specified by:
liesOnin interfaceGeometricPredicates_2- Parameters:
a- ,b,p the 3 points- Returns:
- true if ab contains point p
-