Skip to content

Vectors

2 components

bvec2

bvec2(count = None)

2-components vectors of unsigned bytes (8 bits)

Parameters:

Name Type Description Default
count int

Number of vectors to create

None

Returns:

Type Description
np.ndarray

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

Source code in glm/vec234.py
def bvec2(count = None):
    """2-components vectors of unsigned bytes (8 bits)

    Args:

        count (int):
            Number of vectors to create

    Returns:

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

ivec2

ivec2(count = None)

2-components vectors of integer (32 bits)

Parameters:

Name Type Description Default
count int

Number of vectors to create

None

Returns:

Type Description
np.ndarray

(count,2) shaped array with dtype np.int32

Source code in glm/vec234.py
def ivec2(count = None):
    """2-components vectors of integer (32 bits)

    Args:

        count (int): Number of vectors to create

    Returns:

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

uvec2

uvec2(count = None)

2-components vectors 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) shaped array with dtype np.uint32

Source code in glm/vec234.py
def uvec2(count = None):
    """2-components vectors of unsigned integers (32 bits)


    Args:

        count (int): Number of vectors to create

    Returns:

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

hvec2

hvec2(count = None)

2-components vectors 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) shaped array with dtype np.float16

Source code in glm/vec234.py
def hvec2(count = None):
    """2-components vectors of half precision floats (16 bits)


    Args:

        count (int): Number of vectors to create

    Returns:

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

vec2

vec2(count = None) -> np.ndarray

2-components vectors 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,2) shaped array with dtype np.float32

Source code in glm/vec234.py
def vec2(count = None) -> np.ndarray:
    """2-components vectors of single precision floats (32 bits)

    Args:

        count (int): Number of vectors to create

    Returns:

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

dvec2

dvec2(count = None) -> np.ndarray

2-components vectors 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) shaped array with dtype np.float64

Source code in glm/vec234.py
def dvec2(count = None) -> np.ndarray:
    """2-components vectors of double precision floats (64 bits)

    Args:

        count (int): Number of vectors to create

    Returns:

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

3 components

bvec3

bvec3(count = None)

3-components vectors of booleans (8 bits)

Parameters:

Name Type Description Default
count int

Number of vectors to create

None

Returns:

Type Description
np.ndarray

(count,3) shaped array with dtype np.ubyte

Source code in glm/vec234.py
def bvec3(count = None):
    """3-components vectors of booleans (8 bits)

    Args:

        count (int): Number of vectors to create

    Returns:

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

ivec3

ivec3(count = None)

3-components vectors of signed integers (32 bits)

Parameters:

Name Type Description Default
count int

Number of vectors to create

None

Returns:

Type Description
np.ndarray

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

Source code in glm/vec234.py
def ivec3(count = None):
    """3-components vectors of signed integers (32 bits)

    Args:

        count (int): Number of vectors to create

    Returns:

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

uvec3

uvec3(count = None)

3-components vectors 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) shaped array with dtype np.uint32

Source code in glm/vec234.py
def uvec3(count = None):
    """3-components vectors of unsigned integers (32 bits)

    Args:

        count (int): Number of vectors to create

    Returns:

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

hvec3

hvec3(count = None)

3-components vectors 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) shaped array with dtype np.float16

Source code in glm/vec234.py
def hvec3(count = None):
    """3-components vectors of half precision floats (16 bits)

    Args:

        count (int): Number of vectors to create

    Returns:

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

vec3

vec3(count = None)

3-components vectors 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) shaped array with dtype np.float32

Source code in glm/vec234.py
def vec3(count = None):
    """3-components vectors of single precision floats (32 bits)

    Args:

        count (int): Number of vectors to create

    Returns:

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

dvec3

dvec3(count = None)

3-components vectors 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) shaped array with dtype np.float64

Source code in glm/vec234.py
def dvec3(count = None):
    """3-components vectors of double precision floats (64 bits)

    Args:

        count (int): Number of vectors to create

    Returns:

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

4 components

bvec4

bvec4(count = None)

4-components vectors of booleans (8 bits)

Parameters:

Name Type Description Default
count int

Number of vectors to create

None

Returns:

Type Description
np.ndarray

(count,4) shaped array with dtype np.ubyte

Source code in glm/vec234.py
def bvec4(count = None):
    """4-components vectors of booleans (8 bits)

    Args:

        count (int): Number of vectors to create

    Returns:

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

ivec4

ivec4(count = None)

4-components vectors of signed integers (32 bits)

Parameters:

Name Type Description Default
count int

Number of vectors to create

None

Returns:

Type Description
np.ndarray

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

Source code in glm/vec234.py
def ivec4(count = None):
    """4-components vectors of signed integers (32 bits)

    Args:

        count (int): Number of vectors to create

    Returns:

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

uvec4

uvec4(count = None) -> np.ndarray

4-components vectors 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) shaped array with dtype np.uint32

Source code in glm/vec234.py
def uvec4(count = None) -> np.ndarray:
    """4-components vectors of unsigned integers (32 bits)

    Args:

        count (int): Number of vectors to create

    Returns:

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

hvec4

hvec4(count = None) -> np.ndarray

4-components vectors 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) shaped numpy array with dtype np.float16

Source code in glm/vec234.py
def hvec4(count = None) -> np.ndarray:
    """4-components vectors of half precision floats (16 bits)

    Args:

        count (int): Number of vectors to create

    Returns:

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

vec4

vec4(count = None)

4-components vectors 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) shaped numpy array with dtype np.float32

Source code in glm/vec234.py
def vec4(count = None):
    """4-components vectors of single precision floats (32 bits)

    Args:

        count (int): Number of vectors to create

    Returns:

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

dvec4

dvec4(count = None)

4-components vectors 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) shaped numpy array with dtype np.float64

Source code in glm/vec234.py
def dvec4(count = None):
    """4-components vectors of double precision floats (64 bits)

    Args:

        count (int): Number of vectors to create

    Returns:

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