plot a piecewise parametric function in maple

211 views Asked by At

How to plot a piecewise parametric function in maple ?

An example :

f := proc (t) if t <= .2 and 0 <= t then -t, 2*t elif t <= .4 then 8*t-1.8, 2*t elif t <= .6 then 3*t+.2, -2*t+1.6 elif t <= .8 then 2*t+.8, -t+1 elif t <= 1 then -12*t+12, -t+1 end if end proc;

1

There are 1 answers

0
Akanzar On BEST ANSWER

I found the answer. In case someone needs it :

> X := piecewise(`and`(t <= .2, t >= 0), -t, t <= .4, 8*t-1.8, t <= .6, 3*t+.2, t <= .8, 10*t-4, t <= 1, -20*t+20);
Y := piecewise(`and`(t <= .2, t >= 0), 2*t, t <= .4, 2*t, t <= .6, -2*t+1.6, t <= .8, 1-t, t <= 1, 1-t);
> plot([X(t), Y(t), t = 0 .. 1]);