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.

262 • Chapter 6: <strong>Programming</strong> with Maple Graphicsthe only type of data the Maple plotting data structure accepts. Youmay also want to use the more efficient hardware floating-point calculationsrather than software floating-point operations, whenever possible.For more information on hardware floating-point operations, see the examplesin section 6.7. Instead of writing a procedure for computing thegrid, use the library function convert(..., gridpoints) which, in thecase of a single input, generates a structure of the following form. 3[ a.. b, c.. d, [ [z11, ... , z1n], ... ,[ zm1 , ... , zmn ] ] ]It uses either expressions or procedures as input. The output gives thedomain information a..b and c..d along with the z values of the inputthat it evaluates over the grid.> convert( sin(x*y), ’gridpoints’,> x=0..Pi, y=0..Pi, grid=[2, 3] );[0...3.14159265358979, 0...3.14159265358979, [[0., 0., 0.],[0., −0.975367972083633571, −0.430301217000074065]]]When xy > 0 and ln(−xy) is complex, the grid contains the valueundefined.> convert( (x,y) -> log(-x*y), ’gridpoints’,> 1..2, -2..1, grid=[2,3] );[1...2., −2...1., [[0.693147180559945286,−0.693147180559945286, undefined ],[1.386294361, 0., undefined ]]]Example 6 The version of vectorfieldplot makes use of the convert(...,gridpoints) procedure. The vectorfieldplot command should allow anumber of options. In particular, it should allow a grid = [m,n] option.You can accomplish this by passing the options to convert(...,gridpoints). The utility procedure makevectors handles the interfaceto convert(..., gridpoints).3 A two-dimensional Array is also allowed as the third argument. For more information,see the ?plot3d,structure help page.

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

Saved successfully!

Ooh no, something went wrong!