# Longest distance between curve and point

probably a no brainer - but how do i find the longest distance between the area centroid and the curve around it?

Hi Jo,

I’d use Grasshopper for this. Here’s the definition, right click and assign a pt and crv to the respective components. Let me know if you have any questions. FurthestPointOnCrv.gh (9.7 KB)

thats great. Thank you alot!

Here’s another approach that might work…

–Mitch

Interesting method Mitch.

Yeah, based on the logic that the furthest point on the curve from the centroid should also be the closest point to an imaginary circle centered at the centroid and enclosing the curve. The idea was to avoid explicit sampling of the curve - and thus the possibility of error if the sampling wasn’t fine enough or time consuming oversampling…

However, it will only work on planar curves (well, they have to be planar if you want an area centroid), but the problem is I really don’t know to what tolerance it works. The RhinoCommon method it calls - Rhino.Geometry.Curve.ClosestPoints() does not seem to allow a user-specified tolerance, so something must be hard-coded there - but I have no idea what that is.

Attached are both methods to compare if one is more accurate than the other…

–Mitch

CurveCentroidFurthestPoint2.gh (17.2 KB)

Also to compute the area centroid a lot of sampling happens. Except it happens behind the scenes.

What about creating a sphere centered on the point which is enclosing the curve, then checking for the closest point between the sphere and curve? (If there is such a thing as a bounding box for the curve, that would give you some sort of starting size for the sphere)