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)

Classes

Point Abstract object representation for a point in \(R^n\).

Class Inheritance Diagram

Inheritance diagram of sknano.core.math.point.Point

sknano.core.math.vector Module

Custom NumPy Vector class (sknano.core.math.vector)

Functions

angle(u, v[, degrees]) Compute the angle between two Cartesian Vectors.
cross(u, v[, p0]) Vector cross product of two Vectors.
dot(u, v) Dot product of two Vectors.
scalar_triple_product(u, v, w) Compute scalar triple product of three Vectors.
vector_triple_product(u, v, w) Compute vector triple product of three Vectors.
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

Inheritance diagram of sknano.core.math.vector.Vector, sknano.core.math.vector.NullVector

sknano.core.math.points Module

Points class (sknano.core.math.points)

Classes

Points([points]) Container class for collection of Point objects.

Class Inheritance Diagram

Inheritance diagram of sknano.core.math.points.Points

sknano.core.math.vectors Module

Class for collection of Vectors (sknano.core.math.vectors)

Classes

Vectors([vectors]) Container class for collection of Vector objects.

Class Inheritance Diagram

Inheritance diagram of sknano.core.math.vectors.Vectors

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 Vectors.
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 Vectors.
dot(u, v) Dot product of two Vectors.
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 Vectors.
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 Vectors.

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

Inheritance diagram of sknano.core.math.vector.NullVector, sknano.core.math.point.Point, sknano.core.math.points.Points, sknano.core.math.quaternion.Quaternion, sknano.core.math.vector.Vector, sknano.core.math.vectors.Vectors