Skip to content

VECTOR_LENGTH

Download Flojoy Studio to try this app
The VECTOR_LENGTH node returns the length of the input vector. Params: v : Vector The input vector to find the length of. Returns: out : Scalar The length of the input vector.
Python Code
from flojoy import flojoy, Vector, Scalar


@flojoy
def VECTOR_LENGTH(default: Vector) -> Scalar:
    """The VECTOR_LENGTH node returns the length of the input vector.

    Parameters
    ----------
    v : Vector
        The input vector to find the length of.

    Returns
    -------
    Scalar
        The length of the input vector.
    """

    return Scalar(c=len(default.v))

Find this Flojoy Block on GitHub

Example App

Having problems with this example app? Join our Discord community and we will help you out!
React Flow mini map

In this example, we generate a vector by using a LINSPACE node. Then, the length of this vector is extracted with the VECTOR_LENGTH node. The length is visualized with BIG_NUMBER.