Determining Point On Segment

Download

Download jar file or use maven. psjava requires Java 1.6 (or above)

<dependency>
    <groupId>org.psjava</groupId>
    <artifactId>psjava</artifactId>
    <version>0.1.19</version>
</dependency>

Example Code

Point2D<Integer> point = Point2D.create(5, 0);
Segment2D<Integer> segment = Segment2D.create(Point2D.create(0, 0), Point2D.create(10, 0));
boolean on = PointOnSegment2D.isOn(point, segment, IntegerNumberSystem.getInstance()); // Must be true

Implementation


Copyright 2014 psjava team. View on GitHub