Sphere¶
-
class
sknano.core.geometric_regions.Sphere(center=None, r=1)[source] [edit on github][source]¶ Bases:
sknano.core.geometric_regions.Geometric3DRegionGeometric3DRegionfor a sphere.New in version 0.3.0.
Parameters: - center (array_like, optional) – Either a 3-tuple of floats or an instance of the
Pointclass specifying the \((x,y,z)\) coordinates of theSpherecenter. - r (float, optional) – Sphere radius \(r\)
Attributes
bounding_boxBounding Cuboid.centerSpherecenter point \((h, k, l)\).centroidAlias for center.fmtstrFormat string. measureAlias for volume, which is the measure of a 3D geometric region.ndimReturn the dimensions. pmaxPointat maximum extent.pminPointat minimum extent.rSphereradius, \(r\).volumeSpherevolume, \(V=\frac{4}{3}\pi r^3\).Methods
center_centroid()Center centroidon origin.contains(point)Test region membership of pointinSphere.get_points()Return list of points from GeometricRegion.pointsandGeometricRegion.vectorsrotate(**kwargs)Rotate GeometricRegionpointsandvectors.todict()Returns a dictof theSphereconstructor parameters.translate(t[, fix_anchor_points])Translate GeometricRegionpointsandvectorsbyVectort.Attributes Summary
centerSpherecenter point \((h, k, l)\).centroidAlias for center.rSphereradius, \(r\).volumeSpherevolume, \(V=\frac{4}{3}\pi r^3\).Methods Summary
contains(point)Test region membership of pointinSphere.todict()Returns a dictof theSphereconstructor parameters.Attributes Documentation
Methods Documentation
-
contains(point)[source] [edit on github][source]¶ Test region membership of
pointinSphere.Parameters: point (array_like) – Returns: Trueifpointis withinSphere,Falseotherwise.Return type: boolNotes
A
point\((p_x, p_y, p_z)\) is within the bounded region of a sphere with center \((h, k, l)\) and radius \(r\) if the following is true:\[(p_x - h)^2 + (p_y - k)^2 + (p_z - l)^2 \le r^2\]
- center (array_like, optional) – Either a 3-tuple of floats or an instance of the