xecs.Vec2#
- class xecs.Vec2[source]#
Bases:
Struct
A set of 2D vector values.
Methods
Return the angles between some other vectors.
Return the angles between another vector.
Ensure lengths are no less than min and no more than max.
Get the element wise dot products with some other vectors.
Get the dot products between the vectors and another vector.
Set the values of the vectors.
Create the vectors from a NumPy array.
Create the vectors from x and y values.
Get the squared lengths of the vectors.
Return a copy of the vectors as a NumPy array.
Get the perpendicular dot products with some other vectors.
Get the perpendicular dot products with the vectors and another.
Return a string representation.
Attributes
- angle_between_vec2(other)[source]#
Return the angles between some other vectors.
The returned angles are in radians and in the range
[-pi, pi]
.
- angle_between_xy(x, y)[source]#
Return the angles between another vector.
The returned angles are in radians and in the range
[-pi, pi]
.
- perp_dot_vec2(other)[source]#
Get the perpendicular dot products with some other vectors.
Also known as the 2D cross product.
- perp_dot_xy(x, y)[source]#
Get the perpendicular dot products with the vectors and another.
Also known as the 2D cross product.
- to_str(nesting)#
Return a string representation.