We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I currently use them interchangeably. When I need a vector with specific parameters already in place, I use createVector(). When I don't specify any parameters, I do it this way: var v = new p5.Vector();
I don't really know if there's any huge advantage of using the createVector() function, but I use vectors regularly to shorten my code, so I'm curious.
Answers
Diving in class p5.Vector's constructor below:
https://GitHub.com/processing/p5.js/blob/master/src/math/p5.Vector.js#L54-L87
If we directly use
new
instead of createVector(), property p5 isn't initialized and staysundefined
.And therefore, p5's _angleMode will be ignored. =;
Notice also createVector() unnecessarily instantiates an array to pass as 2nd parameter to p5.Vector. :-<