A parabola is created with a string construction from the control points, A
, B
and C
.
What is the coordinate of a point, P
, if it is T_FRACTION
of the way along the parabola,
from A
to C
?
P = (
PX,
PY
)
First find a point, \pink{Q}
, T_FRACTION
of the way along \blue{\overline{AB}}
.
\pink{Q} = \left(1 - T_FRACTION\right)\blue{A} + \left(T_FRACTION\right)\blue{B}
\begin{eqnarray} \pink{Q_x}
&=& \left(fractionReduce(T_DENOM - T_NUMER, T_DENOM)\right)\blue{A_x} +
\left(T_FRACTION\right)\blue{B_x} \\
&=& \left(fractionReduce(T_DENOM - T_NUMER, T_DENOM)\right)\blue{negParens(AX)} +
\left(T_FRACTION\right)\blue{negParens(BX)} \\
&=& fractionReduce((T_DENOM - T_NUMER) * AX, T_DENOM) + fractionReduce(T_NUMER * BX, T_DENOM)
= \pink{QX}
\end{eqnarray}
\begin{eqnarray} \pink{Q_y}
&=& \left(fractionReduce(T_DENOM - T_NUMER, T_DENOM)\right)\blue{A_y} +
\left(T_FRACTION\right)\blue{B_y} \\
&=& \left(fractionReduce(T_DENOM - T_NUMER, T_DENOM)\right)\blue{negParens(AY)} +
\left(T_FRACTION\right)\blue{negParens(BY)} \\
&=& fractionReduce((T_DENOM - T_NUMER) * AY, T_DENOM) + fractionReduce(T_NUMER * BY, T_DENOM)
= \pink{QY}
\end{eqnarray}
So \pink{Q}
is at (\pink{QX}, \pink{QY})
.
Find a point, \pink{R}
, T_FRACTION
of the way along \blue{\overline{BC}}
,
using the same method.
\pink{R} = \left(1 - T_FRACTION\right)\blue{B} + \left(T_FRACTION\right)\blue{C}
\pink{R}
is at (\pink{RX}, \pink{RY})
.
\green{P}
is T_FRACTION
of the way along \pink{\overline{QR}}
.
\green{P} = \left(1 - T_FRACTION\right)\pink{Q} + \left(T_FRACTION\right)\pink{R}
\green{P}
is at \left(\green{PX_FRACTION}, \green{PY_FRACTION}\right)
.