I’ve got a right triangle and I want to check if a given point is on the Hypotenuse of that triangle. All points are plain integers, not floating-point variables.
(broken image, original location https://tape.bplaced.net/dl/example2.png)
Edit:
All green squares would be on the hypotenuse, the white squares not. I know x, y, the Coordinates of the Corners and the Coordinates of the Point I want to test.
All Coordinates are whole numbers (y is a little bit off in the drawing, sorry).
This could work:
You know the triangle, so just create the function for the hypothenuse, in your example it would be
y = 5x/12. If you now get a point, sayx = 6, y = 3, you can use these variables to see if it comes out right:3 = roundup(5*6/12). If it does, the point is on the triangle, if not – then not.