Home Examples Installation Documentation Contact Help

diag_from_array

Specification

Location Author Maintained by
isl/math/matrix3.py Kenny Erleben DIKU

Purpose & Params

Converts an array of length 3 to a 3 by 3 diagonal matrix.

Example

    v = np.array([1,2,3])
    print(mat3.diag_from_array(v)

output:

   [[1. 0. 0.]
    [0. 2. 0.]
    [0. 0. 3.]]