Sorry John, observe the following code:
Code:
float mul = 1.0;
void setup(){
size(400,400);
background(255);
}
void draw(){
stroke(0);
beginShape(LINE_STRIP);
for(int i = 0; i < 400; i++){
vertex(i, sq(i) * mul);
}
endShape();
stroke(255,0,0);
beginShape(LINE_STRIP);
for(int i = 0; i < 400; i++){
vertex(i, sq(i * mul));
}
endShape();
}
void keyPressed(){
switch(key){
case '+':
case '=':
mul *= 1.5;
break;
case '-':
case '_':
mul /= 1.5;
break;
}
}
Although the change in the curve is achieved faster by multiplication before squaring -
it's still exactly the same curve. Why is this It's because of multiplication, you're putting numbers in a different order but they still follow the same pattern.
I think what I'm aiming for is to increase the sphere of influence of the gravity. For that, I don't need to just scale distance by multiplying it or dividing it - I need to bend it. Curved space (like a Stanislav Lem novel). The equation is just floating out of my reach and I can't seem to put it together - something to do with a curve within that curve - hrmm....
This project is a continuation of
this.
Ah hahgrav = (m1 * m2) / pow(distance, curvature);
It's the power to which distance is multiplied that affects the shape of the curve. A low power (1.1) gives a flatter, more linear curve, a high power (5+) gives you more of a funnel. Top dorrar!