A Flash Developer Resource Site

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.

Any help?

2. ## take 2

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...

3. ## take 3

yet another approach, K = 1 + 2 dot (v1-v2,v0-v1) / dot (v0-v1,v0-v1), this looks far better. I wonder how well is it going to work in 3D...

4. ...but there's a problem if v0=v1 damn.

5. ## take 4 (and final)

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

6. What a fruitful discussion thread
I'd love to help, but I really don't know what you're talking about

7. 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.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

 » Home » Movies » Tutorials » Submissions » Board » Links » Reviews » Feedback » Gallery » Fonts » The Lounge » Sound Loops » Sound FX » About FK » Sitemap