11.07.2015 Views

Advanced Programming Guide

Advanced Programming Guide

Advanced Programming Guide

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

220 • Chapter 6: <strong>Programming</strong> with Maple Graphics363432302826245 6 7 8 9 10 11To draw a line from the last to the first point, append the first pointin L1 to the end of L1.> L2 := [ op(L1), L1[1] ];L2 := [[5, 29], [11, 23], [11, 36], [9, 35], [5, 29]]> plot( L2 );363432302826245 6 7 8 9 10 11Example 1The procedure loopplot automates the previous technique.> loopplot := proc( L )> plot( [ op(L), L[1] ] );> end proc;loopplot := proc(L) plot([op(L), L 1 ]) end procThis procedure has a number of shortcomings.• The loopplot procedure should always verify the input, L, to be a listof points, where a point is a list of two constants. That is, L shouldbe of type list([constant, constant]).

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!