manim.utils.space_ops

Utility functions for two- and three-dimensional vectors.

Functions

R3_to_complex(point)[source]
angle_axis_from_quaternion(quaternion)[source]
angle_between(v1, v2)[source]
angle_between_vectors(v1, v2)[source]

Returns the angle between two 3D vectors. This angle will always be btw 0 and pi

angle_of_vector(vector)[source]

Returns polar coordinate theta when vector is project on xy plane

center_of_mass(points)[source]
compass_directions(n=4, start_vect=array([1.0, 0.0, 0.0]))[source]
complex_func_to_R3_func(complex_func)[source]
complex_to_R3(complex_num)[source]
cross(v1, v2)[source]
get_norm(vect)[source]
get_unit_normal(v1, v2)[source]
get_winding_number(points)[source]
line_intersection(line1, line2)[source]

return intersection point of two lines, each defined with a pair of vectors determining the end points

midpoint(point1, point2)[source]
normalize(vect, fall_back=None)[source]
project_along_vector(point, vector)[source]
quaternion_conjugate(quaternion)[source]
quaternion_from_angle_axis(angle, axis)[source]
quaternion_mult(q1, q2)[source]
rotate_vector(vector, angle, axis=array([0.0, 0.0, 1.0]))[source]
rotation_about_z(angle)[source]
rotation_matrix(angle, axis)[source]

Rotation in R^3 about a specified axis of rotation.

shoelace(x_y)[source]

2D implementation of the shoelace formula.

Returns

Returns signed area.

Return type

float

shoelace_direction(x_y)[source]

Uses the area determined by the shoelace method to determine whether the input set of points is directed clockwise or counterclockwise.

Returns

Either "CW" or "CCW".

Return type

str

thick_diagonal(dim, thickness=2)[source]
z_to_vector(vector)[source]

Returns some matrix in SO(3) which takes the z-axis to the (normalized) vector provided as an argument