Recently I am building a JavaScript module to add convenience functions to draw a quadratic bezier curve. This function have a source point, a target point and a control point and will create svg path
like this:
<path id="active" d="M"+sourcePoint+" Q "+controlPoint+" "+ targetPoint+" " fill="orange"
fill-opacity="0.8" stroke="steelblue" stroke-width="2px" cursor="move">
The point that I have to mention is, control point could change dynamically, So when I change it I have figure Like this:
I downloaded image from this link.
This is a regular way to draw quadratic curve with outer triangle "Imagine a triangle with P0,P1,P2 points".I don't know if there are ways to calculate the B point on the curve?
My goal is draw quadratic curve with inner triangle that P1 is always on curve like this:
is there any way to draw this kind of quadratic curve or calculate the B point on the first picture?