I’m drawing a parabola between three points controlled by sliders, but I need to extend the ends of the parabola off the graph and can’t figure out how to keep the same intersection points and extend the graph…
Any math experts out there that can give me the formula??
para_mc.onEnterFrame = function() {
this.p0._y = this._parent.sliderPara_p0.slide._x*5;
this.p1._x = this._parent.sliderPara_p1.slide._x*5;
this.p2._x = this._parent.sliderPara_p2.slide._x*5;
if ((this.p1._x)<(this.p2._x)) {
this.p0._x = (this.p2._x/2)-(this.p1._x/-2);
} else {
this.p0._x = (this.p1._x/2)-(this.p2._x/-2);
}
clear();
lineStyle(1, 0, 100);
moveTo(this.p1._x+this._x, this.p1._y+this._y);
curveTo(this.p0._x+this._x, (this.p0._y*2)+this._y, this.p2._x+this._x, this.p2._y+this._y);
this._parent.display_a = (this.p0._y*2)/100;
this._parent.display_p = (this.p1._x*2)/100;
this._parent.display_q = (this.p2._x*2)/100;
};
Thanks!!