Skip to content

ORDERED_PAIR_2_VECTOR

The ORDERED_PAIR_2_VECTOR return the y component of an ordered pair as a Vector.Inputs ------ default : OrderedPair The input OrderedPair.Params:Returns:out : VectorThe y component of the input OrderedPair.
Python Code
from flojoy import flojoy, Vector, OrderedPair


@flojoy
def ORDERED_PAIR_2_VECTOR(default: OrderedPair) -> Vector:
    """The ORDERED_PAIR_2_VECTOR return the y component of an ordered pair as a Vector.

    Inputs
    ------
    default : OrderedPair
        The input OrderedPair.

    Returns
    -------
    Vector
        The y component of the input OrderedPair.
    """

    return Vector(v=default.y)

Find this Flojoy Block on GitHub

Example

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

This example shows the function of the ORDERED_PAIR_2_VECTOR node. It changes an Ordered Pair into a Vector. Specifcally, the x axis is removed and the y axis is used as the vector.