Crank Mechanism

Example from the PscFunctions package

With the help of routines of the package one can obtain the unified equations practically of any continuous curve .
For example, routines of the package allow to create the equation of the curve representing an outline of the crank mechanism. For this purpose it is enough to equate a curve containing one arbitrary parameter w. Changing parameter
w  we can create simulation of the mechanism movement.

>    restart;
with(PscFunctions):
x:=(t,w)->cos(w+2*Pi*PR(t,0,1))+sqrt(9-sin(w)^2)*PR(t,1,1)+PR(t,3,1)-PR(t,5,1):
y:=(t,w)->sin(w+2*Pi*PR(t,0,1))-sin(w)*PR(t,1,1)+PR(t,2,1)/4-PR(t,4,1)/2+PR(t,6,1)/4:
plots[animate](plot,[[x(t,w),y(t,w),t=0.03..7],color=BLACK,thickness=2],w=0..2*Pi,scaling=CONSTRAINED);
'X'=x(t,w);
'Y'=y(t,w);

[Maple Plot]

X = cos(w+2*Pi*(1/2+1/2*abs(t)-1/2*abs(t-1)))+(9-sin(w)^2)^(1/2)*(1/2+1/2*abs(t-1)-1/2*abs(t-2))+1/2*abs(t-3)-1/2*abs(t-4)-1/2*abs(t-5)+1/2*abs(t-6)
X = cos(w+2*Pi*(1/2+1/2*abs(t)-1/2*abs(t-1)))+(9-sin(w)^2)^(1/2)*(1/2+1/2*abs(t-1)-1/2*abs(t-2))+1/2*abs(t-3)-1/2*abs(t-4)-1/2*abs(t-5)+1/2*abs(t-6)

Y = sin(w+2*Pi*(1/2+1/2*abs(t)-1/2*abs(t-1)))-sin(w)*(1/2+1/2*abs(t-1)-1/2*abs(t-2))+1/8*abs(t-2)-1/8*abs(t-3)-1/4*abs(t-4)+1/4*abs(t-5)+1/8*abs(t-6)-1/8*abs(t-7)
Y = sin(w+2*Pi*(1/2+1/2*abs(t)-1/2*abs(t-1)))-sin(w)*(1/2+1/2*abs(t-1)-1/2*abs(t-2))+1/8*abs(t-2)-1/8*abs(t-3)-1/4*abs(t-4)+1/4*abs(t-5)+1/8*abs(t-6)-1/8*abs(t-7)