ok.. i'm going to bed right now but let me offer you some last tidbits of advice:
here is code that shows how to "extend" a vector. that is increase it's magnitude. change 30 to whatever value you want to increase (or decrease) it by. you can use this to accelerate and decelerate by extending the velocity vector, causing the ball to get faster while remaining straight.
turning i'm too tired to think through, but it will involve applying the vector to a different angle. try just offsetting a by the desired amount of turn. remember processing works in radians by default.
ok goodnight! goodluck!
Code:
PVector y, v, v2;
void setup(){
size(200,200);
y = new PVector(0,1);//y-axis
v = new PVector(10,20);//the original vector
v2 = new PVector();//resulting vector
line(100,100,100+v.x,100+v.y);
v2 = v.get();
float a = PVector.angleBetween(y,v);
println(a);
// v2.add(cos(a)*30,sin(a)*30, 0);
v2.x += sin(a)*30;
v2.y += cos(a)*30;
println("cos(a) * 30: " + cos(a) * 30);
println("sin(a) * 30: " + sin(a) * 30);
stroke(0,0,255);
line(50,100,50+v2.x,100+v2.y);//show the new vector
stroke(0,255,0);
line(100,100,100+v.x,100+v.y);//show the original
}
p.s. use PVector.limit() for max speed.