armaxis
05/25/2017, 1:18 AMobject Geometry, to internal object, or define as companion class? So many ways to choose from 🙂
public class Geometry {
private Geometry() {}
public static boolean segmentsIntersect(long start1, long end1, long start2, long end2) {
return end1 > start2 && end2 > start1;
}
public static boolean pointWithinSegment(long point, long boundStart, long boundEnd) {
return boundStart <= point && point < boundEnd;
}
}