This is basically an implementation of P5.Vector with no dependencies to P5. It diverges fundamentally from the P5 Vector class in that it always returns a new vector. So if you want to change the existing vector, your need to re-assign the vector to the new output.
Does it make sense to return a new vector each time? I'm not sure! Does it work though? Yes!
See the examples for more insight into the usage.