warp.matrix_from_cols#
- warp.matrix_from_cols(*args)[source]#
Construct a matrix with each vector argument as a column.
The resulting matrix has dimensions
(vector_length, num_vectors), where the i-th column of the matrix contains the elements of the i-th vector argument.- Parameters:
*args (Sequence[Vector]) – Variable number of vectors to use as matrix columns. All vectors must have the same length and dtype.
- Returns:
A matrix with shape
(vector_length, num_vectors).
Example
a = wp.vec3f(1.0, 2.0, 3.0) b = wp.vec3f(4.0, 5.0, 6.0) m = wp.matrix_from_cols(a, b) # m is a 3x2 matrix: # [[1.0, 4.0], # [2.0, 5.0], # [3.0, 6.0]]
See also