sknano.core.geometric_regions.Cone.contains

Cone.contains(point)[source][source]

Test region membership of point in Cone.

Parameters:

point : array_like

Returns:

bool

True if point is within Cone, False otherwise.

Notes

A point \((p_x, p_y, p_z)\) is within the bounded region of a cone with a base of radius \(r\) centered at \(p_1=(x_1, y_1, z_1)\) and tip at \(p_2 = (x_2, y_2, z_2)\) if the following is true:

\[0\le q\le 1\land (x_1 - p_x + (x_2 - x_1) q)^2 + (y_1 - p_y + (y_2 - y_1) q)^2 + (z_1 - p_z + (z_2 - z_1) q)^2 \le r^2 q^2\]

where \(q\) is:

\[q = \frac{(p_x - x_1)(x_2 - x_1) + (p_y - y_1)(y_2 - y_1) + (p_z - z_1)(z_2 - z_1)}{(x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2}\]