Produces the sum of two tuples, the 2 tuples can be of any kind but a Point cannot be subtracted from a Vector Point - Vector -> Point Vector - Vector -> Vector Point - Point -> Vector Vector - Point -/- invalid
const point1 = new Point(3, 2, 1)const point2 = new Point(5, 6, 7)tupleSubtract(point1, point2).components() //-> [-2, -4, -6, 0]
A tuple that is the result of the differece between tuple1 & tuple2 (tuple1-tuple2)
RangeError - Thrown if user is attempting to subtract a Point from a Vector i.e (Vector-Point)
Tuple to subtract from
Tuple to subtract
Generated using TypeDoc
Produces the sum of two tuples, the 2 tuples can be of any kind but a Point cannot be subtracted from a Vector Point - Vector -> Point Vector - Vector -> Vector Point - Point -> Vector Vector - Point -/- invalid
Example
Returns
A tuple that is the result of the differece between tuple1 & tuple2 (tuple1-tuple2)
Throws
RangeError - Thrown if user is attempting to subtract a Point from a Vector i.e (Vector-Point)