Core data structures for math (sknano.core.math
)¶
Introduction¶
The sknano.core.math
package provides abstract
object representations for points and vectors.
Getting Started¶
Contents¶
sknano.core.math.point Module¶
Custom NumPy Point class (sknano.core.math.point
)¶
Class Inheritance Diagram¶
sknano.core.math.vector Module¶
Custom NumPy Vector class (sknano.core.math.vector
)¶
Functions¶
angle (u, v[, degrees]) |
Compute the angle between two Cartesian Vector s. |
cross (u, v[, p0]) |
Vector cross product of two Vector s. |
dot (u, v) |
Dot product of two Vector s. |
scalar_triple_product (u, v, w) |
Compute scalar triple product of three Vector s. |
vector_triple_product (u, v, w) |
Compute vector triple product of three Vector s. |
scalar_projection (a, b) |
Compute the scalar projection of \(\mathbf{a}\) onto \(\mathbf{b}\). |
vector_projection (a, b) |
Compute the vector projection of \(\mathbf{a}\) onto \(\mathbf{b}\). |
vector_rejection (a, b) |
Compute the vector rejection of \(\mathbf{a}\) onto \(\mathbf{b}\). |
projection (a, b) |
Compute the vector projection of \(\mathbf{a}\) onto \(\mathbf{b}\). |
rejection (a, b) |
Compute the vector rejection of \(\mathbf{a}\) onto \(\mathbf{b}\). |
Classes¶
Vector |
Abstract object representation of a vector in \(R^n\) |
NullVector () |
Singleton class for a 3D null vector. |
Class Inheritance Diagram¶
sknano.core.math.vectors Module¶
Class for collection of Vector
s (sknano.core.math.vectors
)¶
Class Inheritance Diagram¶
sknano.core.math.transforms Module¶
Functions for linear algebra transforms (sknano.core.math.transforms
)¶
Functions¶
rotate (obj[, angle, axis, anchor_point, ...]) |
Rotate object. |
Rx (angle[, degrees]) |
Generate the \(3\times3\) rotation matrix \(R_x(\theta)\) for a rotation about the \(x\) axis by an angle \(\theta\). |
Ry (angle[, degrees]) |
Generate the \(3\times3\) rotation matrix \(R_y(\theta)\) for a rotation about the \(y\) axis by an angle \(\theta\). |
Rz (angle[, degrees]) |
Generate the \(3\times3\) rotation matrix \(R_z(\theta)\) for a rotation about the \(z\) axis by an angle \(\theta\). |
rotation_matrix ([angle, axis, anchor_point, ...]) |
Generate an \(n\times n\) rotation matrix. |
reflection_matrix (v) |
Generate reflection matrix that represents reflection of points in a mirror plane defined by normal Vector v . |
scaling_matrix ([s, v]) |
Return scaling matrix. |
translation_matrix (v) |
Generate \(4\times4\) translation matrix given 3D translation Vector v . |
translation_from_augmented_matrix (M) |
Return the translation vector from an affine matrix. |
translation_from_matrix (M) |
Return the translation vector from an affine matrix. |
rotation_matrix_from_augmented_matrix (M) |
Return the linear transformation component from an augmented matrix. |
transformation_matrix ([angle, axis, ...]) |
Generate an \((n+1)\times(n+1)\) transformation matrix for an affine transformation in \(n\) dimensions. |
axis_angle_from_rotation_matrix (rmatrix) |
Compute the rotation axis and angle from a rotation matrix. |
Reference/API¶
sknano.core.math Package¶
Functions¶
Rx (angle[, degrees]) |
Generate the \(3\times3\) rotation matrix \(R_x(\theta)\) for a rotation about the \(x\) axis by an angle \(\theta\). |
Ry (angle[, degrees]) |
Generate the \(3\times3\) rotation matrix \(R_y(\theta)\) for a rotation about the \(y\) axis by an angle \(\theta\). |
Rz (angle[, degrees]) |
Generate the \(3\times3\) rotation matrix \(R_z(\theta)\) for a rotation about the \(z\) axis by an angle \(\theta\). |
abs_cap (val[, max_abs_val]) |
Returns the value with its absolute value capped at max_abs_val. |
angle (u, v[, degrees]) |
Compute the angle between two Cartesian Vector s. |
axis_angle_from_rotation_matrix (rmatrix) |
Compute the rotation axis and angle from a rotation matrix. |
convert_condition_str (obj, condition) |
Evaluates a boolean condtion of an object attribute. |
cross (u, v[, p0]) |
Vector cross product of two Vector s. |
dot (u, v) |
Dot product of two Vector s. |
projection (a, b) |
Compute the vector projection of \(\mathbf{a}\) onto \(\mathbf{b}\). |
reflection_matrix (v) |
Generate reflection matrix that represents reflection of points in a mirror plane defined by normal Vector v . |
rejection (a, b) |
Compute the vector rejection of \(\mathbf{a}\) onto \(\mathbf{b}\). |
rotate (obj[, angle, axis, anchor_point, ...]) |
Rotate object. |
rotation_matrix ([angle, axis, anchor_point, ...]) |
Generate an \(n\times n\) rotation matrix. |
rotation_matrix_from_augmented_matrix (M) |
Return the linear transformation component from an augmented matrix. |
scalar_projection (a, b) |
Compute the scalar projection of \(\mathbf{a}\) onto \(\mathbf{b}\). |
scalar_triple_product (u, v, w) |
Compute scalar triple product of three Vector s. |
scaling_matrix ([s, v]) |
Return scaling matrix. |
totient_func ([n]) |
Compute the totatives of \(n\). |
transformation_matrix ([angle, axis, ...]) |
Generate an \((n+1)\times(n+1)\) transformation matrix for an affine transformation in \(n\) dimensions. |
translation_from_augmented_matrix (M) |
Return the translation vector from an affine matrix. |
translation_from_matrix (M) |
Return the translation vector from an affine matrix. |
translation_matrix (v) |
Generate \(4\times4\) translation matrix given 3D translation Vector v . |
vector_projection (a, b) |
Compute the vector projection of \(\mathbf{a}\) onto \(\mathbf{b}\). |
vector_rejection (a, b) |
Compute the vector rejection of \(\mathbf{a}\) onto \(\mathbf{b}\). |
vector_triple_product (u, v, w) |
Compute vector triple product of three Vector s. |
Classes¶
NullVector () |
Singleton class for a 3D null vector. |
Point |
Abstract object representation for a point in \(R^n\). |
Points ([points]) |
Container class for collection of Point objects. |
Quaternion |
Abstract object representation of a quaternion. |
Vector |
Abstract object representation of a vector in \(R^n\) |
Vectors ([vectors]) |
Container class for collection of Vector objects. |
Class Inheritance Diagram¶