### 2.15 User-defined

That element gives the possibility to the user to create its own graphical element. It will be considered as a whole entity.

• Shortcut: Ctrl+U
• We give a name.
• We enter a command. It can use some graphical commands (straights, curves, ...) or graphical macros (macros that have a graphical effect) like those in the file TeXgraph.mac.
• Examples:
• Here is a command of a User-defined graphical element:
[Courbe(t+i*sin(t)), Arrows:=2, tangente(sin(t), pi/3,2)]

It draws the sinus curve with usual parameters. We set the global variable Arrows to 2 (number of arrows), then we draw a piece of the tangent 2 to the sinus curve at $\pi$/3, length 2 (graphical units).

• Other example:
for m in [-1,-0.25,0.5,2] do Color:=Rgb(Rand(),Rand(),Rand()), Courbe(t+i*t^m) od

It draws cartesian curves family: $t↦{t}^{m}$ with $m$ in the list $\left[-1,-0.25,0.5,2\right]$. For each value of $m$ the color of the drawing is changing.

• Corresponding command: NewGraph.