ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* MP files
@ 2000-10-30  0:24 David Arnold
  0 siblings, 0 replies; only message in thread
From: David Arnold @ 2000-10-30  0:24 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 97 bytes --]

All,

If anyone is interested, here are the MP files I used to craft my linear
algebra activity.

[-- Attachment #2: lvsn.mp --]
[-- Type: text/plain, Size: 8532 bytes --]

input mp-tool;

beginfig(1);

%initialize the scale
numeric u; 10u=2in;

%initialize some points
z0=origin;
z1=(8u,3u);
z2=(5u,8u);

%set penwidth
pickup pencircle scaled 1pt;

%draw and label vector u
drawarrow z0--z1 withcolor blue;
label.lrt(btex ${\bf u}$ etex, 0.5[z0,z1]);

%draw and label vector v
drawarrow z1--z2 withcolor blue;
label.urt(btex ${\bf v}$ etex, 0.5[z1,z2]);

%draw and label vector u+v
drawarrow z0--z2 withcolor red;
label.ulft(btex ${\bf u}+{\bf v}$ etex, 0.5[z0,z2]);

endfig;

beginfig(2);

%initialize the scale
numeric u; 10u=2in;

%draw a grid
for k=0 step 1u until 10u:
 draw (k,0)--(k,10u) withcolor 0.85white;
 draw (0,k)--(10u,k) withcolor 0.85white;
endfor;

%draw coordinate axes
drawarrow (0,0)--(10u,0);
drawarrow (0,0)--(0,10u);

%initialize some points
z0=origin;
z1=(8u,3u);
z2=(5u,8u);

%set penwidth
pickup pencircle scaled 1pt;

%draw and label vector u
drawarrow z0--z1 withcolor blue;
label.lrt(btex ${\bf u}$ etex, 0.5[z0,z1]);

%draw and label vector v
drawarrow z1--z2 withcolor blue;
label.urt(btex ${\bf v}$ etex, 0.5[z1,z2]);

%draw and label vector u+v
drawarrow z0--z2 withcolor red;
label.ulft(btex ${\bf u}+{\bf v}$ etex, 0.5[z0,z2]);

endfig;

beginfig(3);

%initialize the scale
numeric u; 10u=1in;

%initialize some points
z0=origin;
z1=(4u,2u);

%set penwidth
pickup pencircle scaled 1pt;

%draw and label vector 2u
drawarrow z0--2z1 withcolor red;
label.lrt(btex $2{\bf u}$ etex, 0.5[z0,2z1]);

%draw and label vector -1.5u
drawarrow z0--(-1.5z1) withcolor green;
label.ulft(btex $-1.5{\bf u}$ etex, 0.5[z0,-1.5z1]);

%capture bounding box
path bb;
bb:=boundingbox currentpicture;
currentpicture:=nullpicture;

%draw and label vector u
drawarrow z0--z1 withcolor blue;
label.lrt(btex ${\bf u}$ etex, 0.5[z0,z1]);

%set bounding box
setbounds currentpicture to bb;

endfig;

beginfig(4);

%initialize the scale
numeric u; 10u=1in;

%initialize some points
z0=origin;
z1=(4u,2u);

%set penwidth
pickup pencircle scaled 1pt;

%draw and label vector 2u
drawarrow z0--2z1 withcolor red;
label.lrt(btex $2{\bf u}$ etex, 0.5[z0,2z1]);

%draw and label vector -1.5u
drawarrow z0--(-1.5z1) withcolor green;
label.ulft(btex $-1.5{\bf u}$ etex, 0.5[z0,-1.5z1]);

endfig;

beginfig(5);

%initialize the scale
numeric u; 20u=2in;

%draw the grid
for k=-10u step 1u until 10u:
 draw (k,-10u)--(k,10u) withcolor 0.85white;
 draw (-10u,k)--(10u,k) withcolor 0.85white;
endfor;

%draw the axes
drawdblarrow (-10u,0)--(10u,0);
drawdblarrow (0,-10u)--(0,10u);

%initialize some points
z0=origin;
z1=(4u,2u);

%set penwidth
pickup pencircle scaled 1pt;

%draw and label vector u
drawarrow z0--z1 withcolor blue;
label.ulft(btex ${\bf u}$ etex, 0.5[z0,z1]);

endfig;

beginfig(6);

%initialize the scale
numeric u; 10u=1in;

%initialize the scale
numeric u; 20u=2in;

%draw the grid
for k=-10u step 1u until 10u:
 draw (k,-10u)--(k,10u) withcolor 0.85white;
 draw (-10u,k)--(10u,k) withcolor 0.85white;
endfor;

%draw the axes
drawdblarrow (-10u,0)--(10u,0);
drawdblarrow (0,-10u)--(0,10u);

%initialize some points
z0=origin;
z1=(4u,2u);

%set penwidth
pickup pencircle scaled 1pt;

%draw and label vector 2u
drawarrow z0--2z1 withcolor red;
label.ulft(btex $2{\bf u}$ etex, 0.5[z0,2z1]);

%draw and label vector -1.5u
drawarrow z0--(-1.5z1) withcolor green;
label.lrt(btex $-1.5{\bf u}$ etex, 0.75[z0,-1.5z1]);

endfig;

beginfig(7);

%initialize the scale
numeric u; 10u=1in;

%initialize the scale
numeric u; 20u=2in;

%set the bounding box
path bb;
bb:=(-10u,-10u)--(10u,-10u)--(10u,10u)--(-10u,10u)--cycle;

%initialize some points
z0=origin;
z1=(8u,2u);
z2=(2u,6u);

%set penwidth
pickup pencircle scaled 1pt;

%draw and label vector u
drawarrow z0--z1 withcolor blue;
label.ulft(btex ${\bf u}$ etex, 0.5[z0,z1]);

%draw and label vector v
drawarrow z0--z2 withcolor blue;
label.ulft(btex ${\bf v}$ etex, 0.5[z0,z2]);

%attach -v to u
z3=z1-z2;
drawarrow z1--z3 withcolor blue;
label.rt(btex $-{\bf v}$ etex, 0.5[z1,z3]);

%draw u-v
drawarrow z0--z3 withcolor red;
label.llft(btex ${\bf u}+(-{\bf v})$ etex, 0.5[z0,z3]);

%set the bounding box
path bb;
bb:=boundingbox currentpicture;
currentpicture:=nullpicture;

%draw and label vector u
drawarrow z0--z1 withcolor blue;
label.lrt(btex ${\bf u}$ etex, 0.5[z0,z1]);

%draw and label vector v
drawarrow z0--z2 withcolor blue;
label.ulft(btex ${\bf v}$ etex, 0.5[z0,z2]);

%set the bounding box
setbounds currentpicture to bb;
endfig;

beginfig(8);

%initialize the scale
numeric u; 10u=1in;

%initialize the scale
numeric u; 20u=2in;

%initialize some points
z0=origin;
z1=(8u,2u);
z2=(2u,6u);

%set penwidth
pickup pencircle scaled 1pt;

%draw and label vector u
drawarrow z0--z1 withcolor blue;
label.ulft(btex ${\bf u}$ etex, 0.5[z0,z1]);

%draw and label vector v
drawarrow z0--z2 withcolor blue;
label.ulft(btex ${\bf v}$ etex, 0.5[z0,z2]);

%attach -v to u
z3=z1-z2;
drawarrow z1--z3 withcolor blue;
label.rt(btex $-{\bf v}$ etex, 0.5[z1,z3]);

%draw u-v
drawarrow z0--z3 withcolor red;
label.llft(btex ${\bf u}+(-{\bf v})$ etex, 0.5[z0,z3]);

endfig;

beginfig(9);

%initialize the scale
numeric u; 10u=1in;

%draw the grid
for k=-10u step 1u until 10u:
 draw (k,-10u)--(k,10u) withcolor 0.85white;
 draw (-10u,k)--(10u,k) withcolor 0.85white;
endfor;

%draw the axes
drawdblarrow (-10u,0)--(10u,0);
drawdblarrow (0,-10u)--(0,10u);

%initialize the scale
numeric u; 20u=2in;

%initialize some points
z0=origin;
z1=(8u,2u);
z2=(2u,6u);

%set penwidth
pickup pencircle scaled 1pt;

%draw and label vector u
drawarrow z0--z1 withcolor blue;
label.lrt(btex ${\bf u}$ etex, 0.5[z0,z1]);

%draw and label vector v
drawarrow z0--z2 withcolor blue;
label.ulft(btex ${\bf v}$ etex, 0.5[z0,z2]);

%draw u-v
drawarrow z2--z1 withcolor red;
label.urt(btex ${\bf u}-{\bf v}$ etex, 0.5[z2,z1]);

endfig;

beginfig(10);

%initialize the scale
numeric u; 10u=1in;

%draw the grid
for k=-10u step 1u until 10u:
 draw (k,-10u)--(k,10u) withcolor 0.85white;
 draw (-10u,k)--(10u,k) withcolor 0.85white;
endfor;

%draw the axes
drawdblarrow (-10u,0)--(10u,0);
drawdblarrow (0,-10u)--(0,10u);

%initialize the scale
numeric u; 20u=2in;

%initialize some points
z0=origin;
z1=(2u,3u);

%draw a line through (2,3) with slope -3/2
draw (-8u/3,10u)--(10u,-9u) withcolor blue;

%draw and label the point (2,3)
dotlabel.urt(btex $(2,3)$ etex, z1);

endfig;

beginfig(11);

%initialize the scale
numeric u; 10u=1in;

%draw the grid
for k=-10u step 1u until 10u:
 draw (k,-10u)--(k,10u) withcolor 0.85white;
 draw (-10u,k)--(10u,k) withcolor 0.85white;
endfor;

%draw the axes
drawdblarrow (-10u,0)--(10u,0);
drawdblarrow (0,-10u)--(0,10u);

%initialize the scale
numeric u; 20u=2in;

%initialize some points
z0=origin;
z1=(2u,3u);
z2=(4u,0);
z3=(8u,-6u);

%draw a line through (2,3) with slope -3/2
draw (-8u/3,10u)--(10u,-9u) withcolor blue;

%scale the pen
pickup pencircle scaled 1pt;

%draw vector p_0
drawarrow z0--z1 withcolor red;
label.ulft(btex ${\bf p}_0$ etex, 0.5[z0,z1]);

%draw the direction vector v
drawarrow z1--z2 withcolor red;
label.urt(btex ${\bf v}$ etex, 0.5[z1,z2]);

%draw the direction vector p
drawarrow z0--z3 withcolor red;
label.llft(btex ${\bf p}$ etex, 0.5[z0,z3]);

%draw and label the point (2,3)
dotlabel.urt(btex $(2,3)$ etex, z1);

%label the tip of p
dotlabel.urt(btex $(x,y)$ etex, z3);

endfig;

\beginfig(12);

%initialize scale
numeric u; 10u=2in;

%draw the grid
for k=0 step 1u until 10u:
 draw (k,0)--(k,10u) withcolor 0.85white;
 draw (0,k)--(10u,k) withcolor 0.85white;
endfor;

%draw the axes
drawarrow (0,0)--(0,10u);
drawarrow (0,0)--(10u,0);

%draw y=x
drawarrow (0,0)--(10u,10u);

%plot and label (x,y) and its reflection
z0=(7u,3u);
z1=z0 reflectedabout((0,0),(1,1));
dotlabel.lrt(btex $(x_1,x_2)$ etex, z0);
dotlabel.ulft(btex $(x_2,x_1)$ etex, z1);

%connect reflected points
draw z0--z1 dashed evenly withcolor blue;

%draw standard basis vectors
pickup pencircle scaled 1pt;
drawarrow (0,0)--(1u,0) withcolor red;
label.lrt(btex ${\bf e}_1$ etex, (1u,0));
drawarrow (0,0)--(0,1u) withcolor red;
label.ulft(btex ${\bf e}_2$ etex, (0,1u));

\endfig;

\beginfig(13);

%initialize scale
numeric u; 4u=2in;

%draw the grid
for k=-2u step 1u until 2u:
 draw (k,-2u)--(k,2u) withcolor 0.85white;
 draw (-2u,k)--(2u,k) withcolor 0.85white;
endfor;

%draw the axes
drawdblarrow (-2.5u,0)--(2.5u,0);
drawdblarrow (0,-2.5u)--(0,2.5u);

%plot points on the grid
for i=-2u step 1u until 2u:
 for j=-2u step 1u until 2u:
  draw (i,j) withpen pencircle scaled 6pt withcolor blue;
 endfor;
endfor;

\endfig;

end.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-10-30  0:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-10-30  0:24 MP files David Arnold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).