## This is a copy of the JS-EDEN file discussed on 9/7/12 ## Making an arrow (of size proportional to the length of the vector) /* a = 300; b = 300; l is Line(a,b,x,y,"green"); x = 600; y = 400; mu = 0.9; ptarr is [a + 0.9 * (x-a), b + 0.9 * (y-b)]; ## orthl is Line(ptarr[1], ptarr[2], ptarr[1] + (b-y), ptarr[2] + (x-a), "red"); ## picture is [l, orthl]; larr is Line( ptarr[1] + (b-y) * (1-mu), ptarr[2] + (x-a) * (1-mu), x, y, "green"); rarr is Line( ptarr[1] + (b-y) * (mu-1), ptarr[2] + (x-a) * (mu-1), x, y, "green"); picture is [l, larr, rarr]; mvX is Slider("mvX", 100, 500, 5, 300, "horizontal", 300, 10); mvY is Slider("mvY", 100, 500, 5, 300, "vertical", 10, 300); picture is [l, larr, rarr, mvX, mvY]; x is mvX_value; y is mvY_value; ## Exercise: make size of arrow invariant, make a solid arrow head. Possibility of making a JavaScript arrow "object"? */ ## Here is an initial indication as to how this could be described using the JSPE include("jspe.jse"); currentSlide = 1; s1 is Slide("

Making an Arrow

Step 1: The following script defines a vector AX, where A = (a, b) and X = (x, y)a = 300;\nb = 300;\nx = 600;\ny = 400;\nl is Line(a,b,x,y,\"green\");\npicture is [l];

"); s2 is Slide("

Making an Arrow

Step 2: To locate the point where the arrow is placed

"); slideList is [s1,s2];