sknano.core.geometric_regions.Cylinder.contains¶
-
Cylinder.
contains
(point)[source][source]¶ Test region membership of point in
Cylinder
.Parameters: point : array_like
Returns: True if point is within
Cylinder
, False otherwise.Notes
A point (px,py,pz) is within the bounded region of a cylinder with radius r around the line from p1=(x1,y1,z1) to p2=(x2,y2,z2) if the following is true:
0≤q≤1∧(x1−px+(x2−x1)q)2+(y1−py+(y2−y1)q)2+(z1−pz+(z2−z1)q)2≤r2where q is:
q=(px−x1)(x2−x1)+(py−y1)(y2−y1)+(pz−z1)(z2−z1)(x2−x1)2+(y2−y1)2+(z2−z1)2