sknano.core.geometric_regions.Parallelogram¶
-
class
sknano.core.geometric_regions.Parallelogram(o=None, u=None, v=None)[source][source]¶ Geometric2DRegionfor a parallelogram.New in version 0.3.0.
Represents a parallelogram with origin \(o=(o_x, o_y)\) and direction vectors \(\mathbf{u}=(u_x, u_y)\) and \(\mathbf{v}=(v_x, v_y)\).
Parameters: o : array_like, optional
Parallelogram origin. If None, it defaults to o=[0, 0].
u, v : array_like, optional
Parallelogram direction vectors stemming from origin
o. If None, then the default values are u=[1, 0] and v=[1, 1].Notes
Parallelogramrepresents the bounded region \(\left \{o+\lambda_1\mathbf{u}+\lambda_2\mathbf{v}\in R^2 |0\le\lambda_i\le 1\right\}\), where \(\mathbf{u}\) and \(\mathbf{v}\) have to be linearly independent.Calling
Paralleogramwith no parameters is equivalent toParallelogram(o=[0, 0], u=[1, 0], v=[1, 1])Attributes
areaParalleogramarea, \(A=|\mathbf{u}\times\mathbf{v}|\).centerAlias for centroid.centroidParalleogram centroid, \((c_x, c_y)\). fmtstrFormat string. measureAlias for area, which is the measure of a 2D geometric region.o2D point coordinates \((o_x, o_y)\) of origin. u2D direction vector \(\mathbf{u}=(u_x, u_y)\), with origin ov2D direction vector \(\mathbf{v}=(v_x, v_y)\), with origin oMethods
center_centroid()Center centroidon origin.contains(point)Test region membership of point in Parallelogram.rotate([angle, axis, anchor_point, ...])Rotate GeometricRegionpointsandvectors.todict()Returns a dictof theParalleogramconstructor parameters.translate(t[, fix_anchor_points])Translate GeometricRegionpointsandvectorsbyVectort.