MATLAB: Maximum perpendicular distance from line to convex hull boundary

convhullperpendicular distancesymline

I'm looking to find the max perpendicular distance of the 2 faces of a 2D convex hull perpendicular to a symmetry line (y=x). There are 3 possible scenarios
(1) convhull intersects with symline and max perpendicular distance occurs within the symline intersection
(2) convhull intersects with symline but max perpendicular distance to symline does not occur within the symline intersection
(3) convhull does not intersect with symline.
Would like to know how to do so in each of those cases.

Best Answer

I had to do something similar to this some time ago, sorry I don't really remember the specifics but I used rayTriGPU:
To find the intersection between a ray and all of the faces of a convex hull. There is some explanation in the code as to how to do this.
You could adapt this very easily I think to do what you want.
Hope this helps,
NP.