sknano.core.geometric_regions.Parallelogram.contains¶
-
Parallelogram.
contains
(point)[source][source]¶ Test region membership of point in
Parallelogram
.Parameters: point : array_like
Returns: True if point is within
Paralleogram
, False otherwiseNotes
A point \((p_x, p_y)\) is within the bounded region of a parallelogram with origin \((o_x, o_y)\) and direction vectors \(\mathbf{u}=(u_x, u_y)\) and \(\mathbf{v}=(v_x, v_y)\) if the following is true:
\[0\le\frac{(p_y - o_y) v_x + (o_x - p_x) v_y}{u_y v_x - u_x v_y} \le 1 \land 0\le\frac{(p_y - o_y) u_x + (o_x - p_x) u_y}{u_x v_y - u_y v_x} \le 1\]