Point in curve

What is the function in rhinocommon to test if point is in a curve?

I tried this one, but polyline function return always false, and only true when the point is on top of polyline point and false when inside closed polyline.
There is no way check this function for polylines?

private void RunScript(Point3d x, Polyline y, ref object A)
A = y.Contains(x);
B = y.ToPolylineCurve().Contains(x);

Is there also any function to find closest point on polyline or polyline first has to be converted to curve?

Thank you ,

There is this one

Nice, I thought it will return closest point of polyline corners, but id does what I need.

Do you now if there is a method for testing if point is inside closed polyline without converting polyline to curve or polylineCurve?

One solution I know is to make a half infinite line going from the point to test, you get the number of intersections
if uneven => inside,
if even => inside

Some work to treat particular case, but must be effective.

Hi @Petras_Vestartas,

You might consider using Curve.Contains.

– Dale