11-08-2025, 11:36 AM
Quote:I think a more robust solution would be to come up with logic to find a point inside the shape,
What kind of shapes are we talking about? Assuming 2D there are shapes created by points connected by lines that enclose a space which can be described by linear equations for lines and there are closed curves which have far more exotic formula descriptions. I suspect you are talking of the first case of which a triangle is simplest case and finding some point inside not difficult. For that take the midpoint of 2 points and then find midpoint of that point and the third point. I would say:
for triangle {(x1, y1), (x2, y2), (x3, y3)}
pt ((x3 + (x1 + x2)/2)/2, (y3 + (y1 + y2)/2)/2) will be inside it.
724 855 599 923 575 468 400 206 147 564 878 823 652 556 bxor cross forever

