geometry
– Geometry and algebra¶

class
Matrix
(rows)¶ Mathematical representation of a matrix. It supports common operations such as matrix addition (
+
), subtraction (
), and multiplication (*
). AMatrix
object is immutable.Parameters: rows (list) – List of rows. Each row is itself a list of numbers. 
shape
¶ Returns a tuple (
m
,n
), wherem
is the number of rows andn
is the number of columns.


vector
(x, y, z=None)¶ Convenience function to create a
Matrix
with the shape (3
,1
) or (2
,1
).Parameters:  x (float) – xcoordinate of the vector.
 y (float) – ycoordinate of the vector.
 z (float) – zcoordinate of the vector (optional).
Returns: A matrix with the shape of a column vector.
Return type: