On Fri, Feb 3, 2012 at 12:48 PM, Pier <pier at unirc.eu> wrote:
> Thanks everybody for the useful prompt replies.
>
> Just to point out what I was aiming at, here follows the list of
> instructions
> I intended to suggest to my pupils in order to show them the influence of
> the
> parameter K when linearly combining two lines r and s into a star
> (ex:r+K*s).
> Namely, varying K from 0 to a possibly high value, the expression ex
> approaches nearer and nearer the line s.
>
> (%i6) a:1;
> (%i7) b:1;
> (%i8) c:1;
> (%i9) e:1;
> (%i10) f:0.5;
> (%i11) g:1;
> (%i12) r:a*x+b*y+c;
> (%i13) s:e*x+f*y+g;
> (%i14) P:linsolve([r,s],[x,y]); centre point of the star
> (%i15) ex:r+K*s;
> (%i16) solve(ex,y); copy and paste the rhs of the output as rhs of %i17
> (%i17) Z(x,K):=-((2*x+2)*K+2*x+2)/(K+2);
> (%i18) F:makelist(Z(x,K),K,0,10);
> (%i19) plot2d(F,[x,-5,5]);
>
> One thing I haven't been able to do is to avoiding copying-pasting the rhs
> output of %i16
>
> y=-((2*x+2)*K+2*x+2)/(K+2)
>
>
If you want the rhs of something, use the rhs function
rhs(%o16).
But the output of solve is a list, so you probably want to do rhs(%o16[1])
instead.
Ray