sknano.core.geometric_regions.Cylinder¶
-
class
sknano.core.geometric_regions.Cylinder(p1=None, p2=None, r=1)[source][source]¶ Geometric3DRegionfor a cylinder.New in version 0.3.10.
Represents a cylinder of radius \(r\) around the line from \((x_1, y_1, z_1)\) to \((x_2, y_2, z_2)\).
Parameters: p1, p2 : array_like, optional
3-tuples or
Pointclass instances specifying theCylinderaxis from point \(p_1=(x_1,y_1,z_1)\) to \(p_2=(x_2,y_2,z_2)\).r : float, optional
Cylinderradius \(r\)Notes
Cylinderrepresents a cylinder region \(\left\{p_1+\rho\cos(\theta)\mathbf{v}_1 + \rho\sin(\theta)\mathbf{v}_2 + \mathbf{v}_3 z| 0\le\theta\le 2\pi\land 0\le\rho\le 1\land 0\le z\le 1\right\}\) where \(\mathbf{v}_3=p_2 - p_1\) and the vectors \(\{\mathbf{v}_1,\mathbf{v}_2,\mathbf{v}_3\}\) are orthogonal with \(|\mathbf{v}_1|=|\mathbf{v}_2|=1\), and \(p_1=(x_1, y_1, z_1)\) and \(p_2=(x_2,y_2,z_2)\).Calling
Cylinderwith no parameters is equivalent toCylinder(p1=[0, 0, -1], p2=[0, 0, 1], r=1).Attributes
axisCylinderaxisVector\(\boldsymbol{\ell}=p_2 - p_1\).centerAlias for centroid.centroidCylindercentroid, \((c_x, c_y, c_z)\).fmtstrFormat string. measureAlias for volume, which is the measure of a 3D geometric region.p1Cylinderaxis point \(p_1=(x_1, y_1, z_1)\).p2Cylinderaxis point \(p_2=(x_2, y_2, z_2)\).rCylinderradius \(r\).volumeCylindervolume, \(V=\pi r^2 \ell\).Methods
center_centroid()Center centroidon origin.contains(point)Test region membership of point in Cylinder.rotate([angle, axis, anchor_point, ...])Rotate GeometricRegionpointsandvectors.todict()Returns a dictof theCylinderconstructor parameters.translate(t[, fix_anchor_points])Translate GeometricRegionpointsandvectorsbyVectort.