is_inside#

HermiteSpline.is_inside(x, y)#

Determines if a point with coordinates x, y is inside the spline. Only works for closed 2D curves.

To determine whether a point is inside or outside the spline, the winding number is used:

\[wind(\gamma, 0) = \frac{1}{2\pi} \oint_\gamma d\theta = \frac{1}{2\pi} \oint_\gamma \left( \frac{x}{r^2}dy - \frac{y}{r^2}dx \right).\]

For a description of \(d\theta\) check splinebox.spline_curves.Spline.dtheta().

Parameters#

xnumpy.ndarray or float

x coordinate(s) of point(s)

ynumpy.ndarray or float

y coordinate(s) of point(s)

Returns#

valfloat

1 if the point is inside, 0.5 if its on the curve and 0 if it is outside the curve.