Well you can use arrays in construct as {1,2} etc.
So perhaps you have a private variable in your sprite called 'speed' and u set it to {1,2}... but then you want to set the length of that variable...
All I can think of is something like:
Set value 'speed' to vector.setLength('speed',10)
.. so like...have:
vector.setX
vector.setY
vector.setLength
vector.setAngle
and
vector.x
vector.y
vector.length
vector.angle
and then some operational functions
vector.add( v1, v2)
vector.multiply(v1, v2)
vector.subtract(v1, v2)
vector.divide(v1, v2)
vector.dot(v1, v2)
vector.lerp(v1, v2, r)
vector.distance(v1, v2)
and some creational functions
vector.left()
vector.right()
vector.up()
vector.down()
vector.one()
vector.zero()
and overloading the default expression i could make:
vector(1,2)
create the actual vector
Shall I quickly program this and see how it goes?