Function tupleSum

  • Produces the sum of two tuples, the 2 tuples can be of any kind but both cannot be a Point at the same time Point + Vector -> Point Vector + Vector -> Vector Point + Point -/- invalid

    Example

    const point = tuple(3, -2, 5, 1)
    const vector = tuple(-2, 3, 1, 0)
    tupleSum(point, vector).components() //->[1,1,6,1]

    Returns

    A new tuple that

    Throws

    RangeError - Thrown if user attempts to add two Points

    Parameters

    Returns Ttuple

Generated using TypeDoc