public boolean isSameDirection(final Heading headingA, final Heading headingB) { final Angle headingDifference = headingB.subtract(headingA); final boolean sameDirection = headingDifference .isGreaterThanOrEqualTo(this.sameDirectionLowerLimit) && headingDifference.isLessThan(this.sameDirectionUpperLimit); return sameDirection; }
public boolean isOppositeDirection(final Heading incomingEdgeHeading, final Heading outgoingEdgeHeading) { final Angle headingDifference = incomingEdgeHeading.subtract(outgoingEdgeHeading); return headingDifference.isGreaterThanOrEqualTo(this.oppositeDirectionLowerLimit) || headingDifference.isLessThan(this.oppositeDirectionUpperLimit); }
return Optional.of(heading2.get().subtract(heading1.get()));