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.

252 • Chapter 6: <strong>Programming</strong> with Maple Graphics> [ inside[n], vlist[n],> vlist[1], inside[1] ],> STYLE(PATCHNOGRID) );> edges := CURVES( [ op(vlist), vlist[1] ],> [ inside, inside[1] ] );> polys, edges;> end proc:Note that the cutoutPolygon procedure handles input in either listor hfarray form.The following are the corners of a triangle.> triangle := [ [0,2], [2,2], [1,0] ];triangle := [[0, 2], [2, 2], [1, 0]]The cutoutPolygon procedure converts triangle to three polygons(one for each side) and two curves.> cutoutPolygon( triangle, 1/2 );POLYGONS([[ 1 2 , 5 3 ], [0, 2], [2, 2], [3 2 , 5 3 ]],[[ 3 2 , 5 3 ], [2, 2], [1, 0], [1, 2 3 ]], [[1, 2 3 ], [1, 0], [0, 2], [1 2 , 5 3 ]],STYLE(PATCHNOGRID)), CURVES([[0, 2], [2, 2], [1, 0], [0, 2]], [[ 1 2 , 5 3 ], [3 2 , 5 3 ], [1, 2 3 ], [1 2 , 5 3 ]])Use the display command from the plots package to show the triangle.> plots[display]( %, color=red );21.510.500.5 1 1.5 2

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

Saved successfully!

Ooh no, something went wrong!