Processing math: 100%

sknano.core.geometric_regions.Parallelogram

class sknano.core.geometric_regions.Parallelogram(o=None, u=None, v=None)[source][source]

Geometric2DRegion for a parallelogram.

New in version 0.3.0.

Represents a parallelogram with origin o=(ox,oy) and direction vectors u=(ux,uy) and v=(vx,vy).

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

Parallelogram represents the bounded region {o+λ1u+λ2vR2|0λi1}, where u and v have to be linearly independent.

Calling Paralleogram with no parameters is equivalent to Parallelogram(o=[0, 0], u=[1, 0], v=[1, 1])

Attributes

area Paralleogram area, A=|u×v|.
center Alias for centroid.
centroid Paralleogram centroid, (cx,cy).
fmtstr Format string.
measure Alias for area, which is the measure of a 2D geometric region.
o 2D point coordinates (ox,oy) of origin.
u 2D direction vector u=(ux,uy), with origin o
v 2D direction vector v=(vx,vy), with origin o

Methods

center_centroid() Center centroid on origin.
contains(point) Test region membership of point in Parallelogram.
rotate([angle, axis, anchor_point, ...]) Rotate GeometricRegion points and vectors.
todict() Returns a dict of the Paralleogram constructor parameters.
translate(t[, fix_anchor_points]) Translate GeometricRegion points and vectors by Vector t.