Looking at Convert a quadratic bezier to a cubic?, I can finally understand why programming teachers always told me that math was so important. Sadly, I didn\'t listen.
Your code is right except that you should use 2.0/3.0 instead of 0.66.
2.0/3.0
0.66