Geben Sie eine gradlinige Verbindung
\gamma: [0,L] \to \mathbb R^2,
\gamma(t) = { \color{teal}\begin{pmatrix} x(t) \\y(t) \end{pmatrix}}
vom Punkt
\mathbf {\color{red}A} zum Punkt \mathbf {\color{blue}B} an.
{\color{teal}x(t)}
=
X + fractionReduce(P-X,L) * t
{\color{teal}y(t)}
=
Y + fractionReduce(Q-Y,L) * t
Der Punkt \mathbf {\color{red}A} hat die Koordinaten {\color{red}(X,Y)},
der Punkt \mathbf {\color{blue}B} ist \color{blue} (P,Q).
Für die gradlinige Verbindung von {\color{red}(X,Y)} nach
\color{blue} (P,Q) brauchen wir den Richtungsvektor.
Dies ist der Vektor \color{orange}\begin{pmatrix} P-X\\Q-Y\end{pmatrix} .
Damit haben wir die (naheliegende) Parametrisierung
\gamma: [0,1] \to \mathbb R^2, \gamma(t) = { \color{red}\begin{pmatrix}X\\Y\end{pmatrix} }+
t \cdot { \color{orange}\begin{pmatrix} P-X\\Q-Y\end{pmatrix} }= { \color{teal}
\begin{pmatrix} X + P-X \cdot t \\
Y + Q-Y \cdot t \end{pmatrix}} .
Das Intervall ist aber nicht [0,1] sondern \color{purple}[0,L]. Damit haben wir
also für den Durchlauf mehr Zeit.
In der Parametriserung oben ersetzen wir t durch \dfrac t{L} und erhalten
\gamma: [0,L] \to \mathbb R^2, \gamma(t) =
{ \color{red}\begin{pmatrix}X\\Y\end{pmatrix} }+
\dfrac t{L} \cdot { \color{orange}\begin{pmatrix} P-X\\Q-Y\end{pmatrix} }=
{ \color{teal} \begin{pmatrix} X + fractionReduce(P-X,L) \cdot t \\
Y + fractionReduce(Q-Y,L) \cdot t \end{pmatrix}} .