Answer the question
In order to leave comments, you need to log in
How to determine if a point belongs to a rhombus?
Everything is known about a rhombus (Points, diagonals) A
point is given by X, Y
coordinates .
Answer the question
In order to leave comments, you need to log in
Actually, if you have dagonals dx, dy, and they are parallel to the axes, and the center is rx, ry, the point is x, y, then the check comes down to the following:
|(x - rx) / dx| + |(y - ry) / dy| <= 2.
Everything.
It is necessary to check four times that the point lies on one side of the line containing the side of the rhombus:
The sign Q determines on which side of the line AB the point T lies.
It remains to check this for all sides of the rhombus AB, BC, CD, DA , if the sign is everywhere the same - a point in a rhombus.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question