Hi, I need to extrapolate vector v_1 from v0, v1 and v2 (see attached pic), so that if v2 is on the right/left (2D case for simplicity) of v1-v0, v_1 would also be on the right/left.
My initial solution was like this:
v2 - v1 = v1 - v0 + some dv,
v1 - v0 = v0 - v_1 + dv,
and from there
v_1 = 3(v0 - v1) + v2.
This, however, produces ugly results when abs (v2-v1) < abs (v1-v0) - point v_1 is placed very far from v0. So I need a better formula for this.
so I was trying another approach (see attached jpeg), it resulted into formula v_1 = 2 (v0 - v1) + v2... this works even worse, don't try it... like you would
Update: I made test SWF for v_1 = K (v0 - v1) + v2...
this is basically last thing re-normalized to v0-v1. I think I can handle 0 vector case, and live with this result. thanks everybody for your generous help
I needed to extrapolate beyond vector array endpoints, in order to pass extrapolated vector into cubic spline (which requires 4 vectors to interpolate between 2 of them).
There is no "correct" answer to this, it is all about how much the end result looks like I had envisioned it in the start.