← All examples

Vector Functions of the Cursor

Four userline vectors driven by functions of the cursor position — reflections, projections, and trig transforms of your pointer.

This diagram is interactive — use your mouse or touch to play with it.

Rendering LaTeX…

Source

\definecolor{lightblue}{RGB}{173,216,230}
\begin{pspicture}(-2,-2)(2,2)
\psframe(-2,-2)(2,2)
\userline[linewidth=2pt,linecolor=green]{->}(0,0)(2,2){-x}{-y}
\userline[linewidth=2pt,linecolor=red]{->}(0,0)(2,2){0}{y}
\userline[linewidth=2pt,linecolor=violet]{->}(0,0)(2,2){-x}{cos(y)}
\userline[linewidth=2pt,linecolor=lightblue]{->}(0,0)(2,2)(sin(x)}{-y}
\end{pspicture}
Open in sandbox