coords.Coords.rosette#

Coords.rosette(n, angle=None, axis=2, around=(0.0, 0.0, 0.0), angle_spec=0.017453292519943295)#

Create rotational replications of a Coords.

Parameters#

n: int

Number of copies to create

angle: float

Angle in between successive copies. If not provided, it is set to 360 / n.

axis: int (0,1,2) or float array_like (3,)

The rotation axis. An int speficies one of the global axes: 0 (X-axis), 1 (Y-axis) and 2 (Z-axis). Else, it is the direction vector of the axis.

around: float array_like (3,), optional

If provided, it species a point on the rotation axis. If not, the rotation axis goes through the origin of the global axes.

angle_spec: float, DEG or RAD, optional

The default (DEG) interpretes the angle in degrees. Use RAD to specify the angle in radians.

Returns#

Coords

A Coords array with an extra first dimension equal to n. The Coords holds n rotational replications with given angular step. The input Coords is the first of the n replicas.

Examples#

>>> Coords([1., 0., 0.]).rosette(4, angle=90.0)
Coords([[ 1.,  0.,  0.],
        [ 0.,  1.,  0.],
        [-1.,  0.,  0.],
        [-0., -1.,  0.]])
>>> Coords([1., 0., 0.]).rosette(3, angle=90.0, around=(0.,1.,0.))
Coords([[ 1.,  0.,  0.],
        [ 1.,  2.,  0.],
        [-1.,  2.,  0.]])