We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I'm just going through the nature of code and I've got to this part
So creating the first one is straight forward, but I'm not sure how to go about making the second one equal to the first multiplied by two
What I wanted to do was :
PVector v = new PVector (1,5);
PVector u = new PVector(v.x*2,v.y*2);
But that can't be correct as the dot method is used in the example...
So I'm not sure how to go about that, I'm aware that there are the static methods add(), sub(), mult, div()
in the PVector class, but I'm not sure how to go about using them in this instance.
I've tried bashing about with things such as
PVector u = PVector.add(v.mult(2));
But that's obviously wrong.
Any help appreciated, cheers
Answers
there are other pvector mult methods and one of the examples does what you want.
https://processing.org/reference/PVector_mult_.html
indeed, cheers Koog, can't mark thread solved for some reason