Generating bezier handles based on constraints

I want to try to emulate what this application can do:

Given the red round dots (from the mouse) it is able to solve for the bezier handles given that the tension of the curve is set to 0.6. How could I solve for the bezier handles? Is there some way I could do this with the slope or perpendicular of the previous and next curve?

Thanks

*I should also add that each point is equadistant meaning point i + 1 is the distance to point i or point i + 2.

-
From the graphic, it appears that the handles at a given point $p_k$ are parallel to the line through $p_{k-1}$ and $p_{k+1}$ and that the lengths of the handles at every point are equal. I suspect that the length of the handles is determined by the "tension" that you mention.