Math Properties¶
Note
Math Properties require numpy
and vectormath
to be
installed. This may be installed with pip install properties[full]
,
pip install properties[math]
, or
pip install numpy vectormath
.
Array¶
-
class
properties.
Array
(doc, **kwargs)[source]¶ Property for
numpy arrays
Available keywords (in addition to those inherited from Property):
- shape - Tuple (or set of valid tuples) that describes the allowed shape of the array. Length of shape tuple corresponds to number of dimensions; values correspond to the allowed length for each dimension. These values may be integers or ‘*’ for any length. For example, an n x 3 array would be shape (‘*’, 3). None may also be used if any shape is valid. The default value is (‘*’,).
- dtype - Allowed data type for the array. May be float, int, bool, or a tuple containing any of these. The default is (float, int).
Vector3¶
-
class
properties.
Vector3
(doc, **kwargs)[source]¶ Property for
3D vectors
These Vectors are of shape (3,) and dtype float. In addition to length-3 arrays, these properties accept strings including: ‘zero’, ‘x’, ‘y’, ‘z’, ‘-x’, ‘-y’, ‘-z’, ‘east’, ‘west’, ‘north’, ‘south’, ‘up’, and ‘down’.
Available keywords (in addition to those inherited from Property):
- length - On validation, vectors are scaled to this length. If None (the default), vectors are not scaled
Vector2¶
-
class
properties.
Vector2
(doc, **kwargs)[source]¶ Property for
2D vectors
These Vectors are of shape (2,) and dtype float. In addition to length-2 arrays, these properties accept strings including: ‘zero’, ‘x’, ‘y’, ‘-x’, ‘-y’, ‘east’, ‘west’, ‘north’, and ‘south’.
Available keywords (in addition to those inherited from Property):
- length - On validation, vectors are scaled to this length. If None (the default), vectors are not scaled
Vector3Array¶
-
class
properties.
Vector3Array
(doc, **kwargs)[source]¶ Property for an
array of 3D vectors
This array of vectors are of shape (‘*’, 3) and dtype float. In addition to an array of this shape, these properties accept a list of strings including: ‘zero’, ‘x’, ‘y’, ‘z’, ‘-x’, ‘-y’, ‘-z’, ‘east’, ‘west’, ‘north’, ‘south’, ‘up’, and ‘down’.
Available keywords (in addition to those inherited from Property):
- length - On validation, all vectors are scaled to this length. If None (the default), vectors are not scaled
Vector2Array¶
-
class
properties.
Vector2Array
(doc, **kwargs)[source]¶ Property for an
array of 2D vectors
This array of vectors are of shape (‘*’, 2) and dtype float. In addition to an array of this shape, these properties accept a list of strings including: ‘zero’, ‘x’, ‘y’, ‘-x’, ‘-y’, ‘east’, ‘west’, ‘north’, and ‘south’.
Available keywords (in addition to those inherited from Property):
- length - On validation, all vectors are scaled to this length. If None (the default), vectors are not scaled