# Finding two bezier control points given three points

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 bezier 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 bezier 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!

-
This question might be better at math.stackexchange.com – David Roberts Jul 16 '11 at 0:28