My apologies if this is asked in the wrong spot, I believe that this problem has a fairly simple solution... but it is beyond me. Given three points (A,B,C) drawn at random, how do you figure out the middle point's (B) control points (B1?, B2?) for a Bézier curve? The image below will help illustrate what I am looking for. The best way I can describe it (not knowing the lingo that is) would be needing the tangent of the angle formed.
I have the incorrect control points (B1, B2) coordinates calculated now as 1/6 the distance of the line length. But they would have to be higher (in this example) to give a proper Bézier curve. How can I calculate those coordinates (B1?, B2?) given that I have the coordinates for all the other points labeled below? Hopefully this is as simple as I imagine!
Here is how I calculate the incorrect (B1, B2) control points:
B1x = Bx - ((Bx - Ax)/6) B1y = By - ((By - Ay)/6) B2x = Cx + ((Bx - Cx)/6) B2y = Cy + ((By - Cy)/6)
Thank you SO much in advance!
[Edit: Example points]
In an attempt to track/test my work I am posting example coordinates for the points (only roughly matching the diagram above).
A: (6, 12) B: (13, 5) C: (17, 10)
Given those points, I got:
- $\Delta\vec a$ =
(-7, 7)
- $\Delta\vec c$ =
(4, 5)
- $n(\Delta \vec a)$ =
(0.707106781, 0.707106781)
- incorrect? - $n(\Delta \vec c)$ =
(0.780868809, 0.624695048)
- incorrect? - $\vec m$ =
(0.745128018, 0.666921463)
- incorrect?
Per your example, for the first coordinate of the first point I had the equation:
$ 14.22939851=b_{11}=13+\frac{\sqrt{7^2+7^2}}60.745128018\ $
I stopped here because I felt as if I had gone off track.
[Edit 2:]
I now have everything working! But there seems to be an issue with certain angels having incorrect control points:
B has correct control points (as do most points drawn) but C's control points are off... it appears to be an issue with signs, like when certain vectors are negative. There are no absolute values in my equations... but you mention a $\vec x'=\vec x/|\vec x|$ in your example... might that be the issue?
Perhaps messing around within my sandbox will help to see the problem? I can also post the code (which is available as the source-code of that page). Click at least three points here