After Googling and looking on Stack for a long time, I've only managed to find methods for determining whether or not a point falls on the line that connects two points. This, unfortunately, isn't what I need.
Please see the image at the end of this question. I apologize in advance for the terrible picture, but it gets the point (get it?) across.
I need to create two perpendicular lines to the one that joins the points x and y. They need to intersect with the perpendicular line at points x and y. I then need to then tell if point z appears between those two lines or not.
Any help is appreciated. Thanks for your time!

Compute the angle xyz and yxz. If either is > 90 then it is outside.
Since you tagged your question with java, here you go:
import javafx.geometry.Point2D;
....
// is z between parallel lines
boolean betweenLines(Point2D x, Point2D y, Point2D z) {
return x.angle(y,z) < 90 && y.angle(x,z) < 90;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With