17 lines
364 B
Plaintext
17 lines
364 B
Plaintext
PVector v1 = new PVector(5, 7);
|
|
PVector v2 = new PVector(2, 3);
|
|
|
|
println(v1.x, v1.y, v1.mag(), v1.heading(),'\n');
|
|
|
|
// static methods
|
|
println(PVector.add(v1, v2));
|
|
println(PVector.sub(v1, v2));
|
|
println(PVector.mult(v1, 11));
|
|
println(PVector.div(v1, 2), '\n');
|
|
|
|
// object methods
|
|
println(v1.sub(v1));
|
|
println(v1.add(v2));
|
|
println(v1.mult(10));
|
|
println(v1.div(10));
|