Skip to content

Matrices

2x2 matrices

bmat2

bmat2(count = None)

2x2 matrices of booleans (8 bits)

Parameters:

Name Type Description Default
count int

Number of vectors to create

None

Returns:

Type Description
np.ndarray

(count, 2, 2) shaped numpy array with dtype np.ubyte

Source code in glm/mat234.py
def bmat2(count = None):
    """2x2 matrices of booleans (8 bits)

    Args:

        count (int): Number of vectors to create

    Returns:

        (np.ndarray): (count, 2, 2) shaped numpy array with dtype np.ubyte
    """
    return ndarray.mat2(count, dtype=np.uint8)

imat2

imat2(count = None)

2x2 matrices of integers (32 bits)

Parameters:

Name Type Description Default
count int

Number of vectors to create

None

Returns:

Type Description
np.ndarray

(count, 2, 2) shaped numpy array with dtype np.int8

Source code in glm/mat234.py
def imat2(count = None):
    """2x2 matrices of integers (32 bits)

    Args:

        count (int): Number of vectors to create

    Returns:

        (np.ndarray): (count, 2, 2) shaped numpy array with dtype np.int8
    """
    return ndarray.mat2(count, dtype=np.int32)

umat2

umat2(count = None)

2x2 matrices of unsigned integers (32 bits)

Parameters:

Name Type Description Default
count int

Number of vectors to create

None

Returns:

Type Description
np.ndarray

(count, 2, 2) shaped numpy array with dtype np.uint8

Source code in glm/mat234.py
def umat2(count = None):
    """2x2 matrices of unsigned integers (32 bits)

    Args:

        count (int): Number of vectors to create

    Returns:

        (np.ndarray): (count, 2, 2) shaped numpy array with dtype np.uint8
    """
    return ndarray.mat2(count, dtype=np.uint32)

hmat2

hmat2(count = None)

2x2 matrices of half precision floats (16 bits)

Parameters:

Name Type Description Default
count int

Number of vectors to create

None

Returns:

Type Description
np.ndarray

(count, 2, 2) shaped numpy array with dtype np.float16

Source code in glm/mat234.py
def hmat2(count = None):
    """2x2 matrices of half precision floats (16 bits)

    Args:

        count (int): Number of vectors to create

    Returns:

        (np.ndarray): (count, 2, 2) shaped numpy array with dtype np.float16
    """
    return ndarray.mat2(count, dtype=np.float16)

mat2

mat2(count = None)

2x2 matrices of double precision floats (32 bits)

Parameters:

Name Type Description Default
count int

Number of vectors to create

None

Returns:

Type Description
np.ndarray

(count, 2, 2) shaped numpy array with dtype np.float32

Source code in glm/mat234.py
def mat2(count = None):
    """2x2 matrices of double precision floats (32 bits)

    Args:

        count (int): Number of vectors to create

    Returns:

        (np.ndarray): (count, 2, 2) shaped numpy array with dtype np.float32
    """
    return ndarray.mat2(count, dtype=np.float32)

dmat2

dmat2(count = None)

2x2 matrices of double precision floats (64 bits)

Parameters:

Name Type Description Default
count int

Number of vectors to create

None

Returns:

Type Description
np.ndarray

(count, 2, 2) shaped numpy array with dtype np.float64

Source code in glm/mat234.py
def dmat2(count = None):
    """2x2 matrices of double precision floats (64 bits)

    Args:

        count (int): Number of vectors to create

    Returns:

        (np.ndarray): (count, 2, 2) shaped numpy array with dtype np.float64
    """
    return ndarray.mat2(count, dtype=np.float64)

3x3 matrices

bmat3

bmat3(count = None)

3x3 matrices of booleans (8 bits)

Parameters:

Name Type Description Default
count int

Number of vectors to create

None

Returns:

Type Description
np.ndarray

(count, 3, 3) shaped numpy array with dtype np.uint8

Source code in glm/mat234.py
def bmat3(count = None):
    """3x3 matrices of booleans (8 bits)

    Args:

        count (int): Number of vectors to create

    Returns:

        (np.ndarray): (count, 3, 3) shaped numpy array with dtype np.uint8
    """
    return ndarray.mat3(count, dtype=np.uint8)

imat3

imat3(count = None)

3x3 matrices of integers (32 bits)

Parameters:

Name Type Description Default
count int

Number of vectors to create

None

Returns:

Type Description
np.ndarray

(count, 3, 3) shaped numpy array with dtype np.int32

Source code in glm/mat234.py
def imat3(count = None):
    """3x3 matrices of integers (32 bits)

    Args:

        count (int): Number of vectors to create

    Returns:

        (np.ndarray): (count, 3, 3) shaped numpy array with dtype np.int32
    """
    return ndarray.mat3(count, dtype=np.int32)

umat3

umat3(count = None)

3x3 matrices of unsigned integers (32 bits)

Parameters:

Name Type Description Default
count int

Number of vectors to create

None

Returns:

Type Description
np.ndarray

(count, 3, 3) shaped numpy array with dtype np.uint32

Source code in glm/mat234.py
def umat3(count = None):
    """3x3 matrices of unsigned integers (32 bits)

    Args:

        count (int): Number of vectors to create

    Returns:

        (np.ndarray): (count, 3, 3) shaped numpy array with dtype np.uint32
    """
    return ndarray.mat3(count, dtype=np.uint32)

hmat3

hmat3(count = None)

3x3 matrices of half precision floats (16 bits)

Parameters:

Name Type Description Default
count int

Number of vectors to create

None

Returns:

Type Description
np.ndarray

(count, 3, 3) shaped numpy array with dtype np.float16

Source code in glm/mat234.py
def hmat3(count = None):
    """3x3 matrices of half precision floats (16 bits)

    Args:

        count (int): Number of vectors to create

    Returns:

        (np.ndarray): (count, 3, 3) shaped numpy array with dtype np.float16
    """
    return ndarray.mat3(count, dtype=np.float16)

mat3

mat3(count = None)

3x3 matrices of single precision floats (32 bits)

Parameters:

Name Type Description Default
count int

Number of vectors to create

None

Returns:

Type Description
np.ndarray

(count, 3, 3) shaped numpy array with dtype np.float32

Source code in glm/mat234.py
def mat3(count = None):
    """3x3 matrices of single precision floats (32 bits)

    Args:

        count (int): Number of vectors to create

    Returns:

        (np.ndarray): (count, 3, 3) shaped numpy array with dtype np.float32
    """
    return ndarray.mat3(count, dtype=np.float32)

dmat3

dmat3(count = None)

3x3 matrices of double precision floats (64 bits)

Parameters:

Name Type Description Default
count int

Number of vectors to create

None

Returns:

Type Description
np.ndarray

(count, 3, 3) shaped numpy array with dtype np.float64

Source code in glm/mat234.py
def dmat3(count = None):
    """3x3 matrices of double precision floats (64 bits)

    Args:

        count (int): Number of vectors to create

    Returns:

        (np.ndarray): (count, 3, 3) shaped numpy array with dtype np.float64
    """
    return ndarray.mat3(count, dtype=np.float64)

4x4 matrices

bmat4

bmat4(count = None)

4x4 matrices of booleans (8 bits)

Parameters:

Name Type Description Default
count int

Number of vectors to create

None

Returns:

Type Description
np.ndarray

(count, 4, 4) shaped numpy array with dtype np.uint8

Source code in glm/mat234.py
def bmat4(count = None):
    """4x4 matrices of booleans (8 bits)

    Args:

        count (int): Number of vectors to create

    Returns:

        (np.ndarray): (count, 4, 4) shaped numpy array with dtype np.uint8
    """
    return ndarray.mat4(count, dtype=np.uint8)

imat4

imat4(count = None)

4x4 matrices of integers (32 bits)

Parameters:

Name Type Description Default
count int

Number of vectors to create

None

Returns:

Type Description
np.ndarray

(count, 4, 4) shaped numpy array with dtype np.int32

Source code in glm/mat234.py
def imat4(count = None):
    """4x4 matrices of integers (32 bits)

    Args:

        count (int): Number of vectors to create

    Returns:

        (np.ndarray): (count, 4, 4) shaped numpy array with dtype np.int32
    """
    return ndarray.mat4(count, dtype=np.int32)

umat4

umat4(count = None)

4x4 matrices of unsigned integers (32 bits)

Parameters:

Name Type Description Default
count int

Number of vectors to create

None

Returns:

Type Description
np.ndarray

(count, 4, 4) shaped numpy array with dtype np.uint32

Source code in glm/mat234.py
def umat4(count = None):
    """4x4 matrices of unsigned integers (32 bits)

    Args:

        count (int): Number of vectors to create

    Returns:

        (np.ndarray): (count, 4, 4) shaped numpy array with dtype np.uint32
    """
    return ndarray.mat4(count, dtype=np.uint32)

hmat4

hmat4(count = None)

4x4 matrices of half precision floats (16 bits)

Parameters:

Name Type Description Default
count int

Number of vectors to create

None

Returns:

Type Description
np.ndarray

(count, 4, 4) shaped numpy array with dtype np.float16

Source code in glm/mat234.py
def hmat4(count = None):
    """4x4 matrices of half precision floats (16 bits)

    Args:

        count (int): Number of vectors to create

    Returns:

        (np.ndarray): (count, 4, 4) shaped numpy array with dtype np.float16
    """
    return ndarray.mat4(count, dtype=np.float16)

mat4

mat4(count = None)

4x4 matrices of single precision floats (32 bits)

Parameters:

Name Type Description Default
count int

Number of vectors to create

None

Returns:

Type Description
np.ndarray

(count, 4, 4) shaped numpy array with dtype np.float32

Source code in glm/mat234.py
def mat4(count = None):
    """4x4 matrices of single precision floats (32 bits)

    Args:

        count (int): Number of vectors to create

    Returns:

        (np.ndarray): (count, 4, 4) shaped numpy array with dtype np.float32
    """
    return ndarray.mat4(count, dtype=np.float32)

dmat4

dmat4(count = None)

4x4 matrices of double precision floats (64 bits)

Parameters:

Name Type Description Default
count int

Number of vectors to create

None

Returns:

Type Description
np.ndarray

(count, 4, 4) shaped numpy array with dtype np.float64

Source code in glm/mat234.py
def dmat4(count = None):
    """4x4 matrices of double precision floats (64 bits)

    Args:

        count (int): Number of vectors to create

    Returns:

        (np.ndarray): (count, 4, 4) shaped numpy array with dtype np.float64
    """
    return ndarray.mat4(count, dtype=np.float64)