Hy every one,
Here is my probleme i try to get angle between two Vectors in p5 when both Can moove. What i’ve done is :
Push();
Translate(...);
Bb= createVector (mouseX,mouseY)
RotateZ(x);
Aa= createVector(0,100);
Pop();
Cc=aa.angleBetween(bb);
x=mooving by an action/
So I get Cc for the first angle event I moove the mouse but if I change x it doesn’t change my angle.
Thanks a lot for your help and sorry for language I’m french ;)``
I found the solution because when i use rotation the vector have a rotation in the same time the 0 position change that why my angle is steel the same so I use this.
push();
translate(x,y);
Bb= createVector(mouseX,mouseY);
Aa = p5.Vector.fromAngle (radians(x));//Changing by an action
pop();
Cc=Bb.angleBetween(Aa);