How do I extrapolate a path point?

Hi :slight_smile:

I have a 2D path made up of three points B, C and D. I would like to extrapolate the position of A. The angle on the path at point B must equal to angle at point C and the distance between C and B must be the same as the distance between B and A.

I can work it out using trigonometry in specific situations but when I give my function arbitrary point I get all sorts of anomalies. I can’t figure out a solution that works 100% of the time.

Is their an elegant solution for this type of problem? Yes I’ve tried google but I haven’t found anything helpful.

Thanks for reading :slight_smile:

For the angle, Vector3.Angle is directionless – could be left or right (or up.) So, as Robertbu mentions, quaternions are the way to go.(not tested):

Quaternion DCBbend = Quaternion.FromToRotation(C-D, B-C);
Vector3 BAseg = DBCbend * (B-C);
Vector3 A = B+BAseg;