11.07.2015 Views

Advanced Programming Guide

Advanced Programming Guide

Advanced Programming Guide

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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

32 • Chapter 2: Procedures, Variables, and Extending Maple(7 &^ 8) &^ 9> evalb( 7 &^ 8 = 8 &^ 7 );false> evalb( (7&^8)&^9 = 7&^(8&^9) );falseInternally, Maple represents neutral operators as procedure calls.Thus, 7&^8 is a convenient way of writing &^(7,8).> &^(7, 8);7 &^ 8Maple uses the infix notation, in which the operator is placed betweenthe operands, only if your neutral operator has exactly two arguments.> &^(4), &^(5, 6), &^(7, 8, 9);‘&^‘(4), 5 &^ 6, ‘&^‘(7, 8, 9)Information: For more information on naming conventions for neutraloperators, see Chapter 3 of the Introductory <strong>Programming</strong> <strong>Guide</strong>.Example 1You can define the actions of a neutral operator by assigning a procedureto its name. The following example implements the Hamiltonians byassigning a neutral operator to a procedure that multiplies two Hamiltonians.Mathematical Premise The Hamiltonians or Quaternions extend thecomplex numbers in the same way the complex numbers extend the realnumbers. Each Hamiltonian has the form a + bi + cj + dk where a, b,c, and d are real numbers. The special symbols i, j, and k satisfy thefollowing multiplication rules: i 2 = −1, j 2 = −1, k 2 = −1, ij = k,ji = −k, ik = −j, ki = j, jk = i, and kj = −i.

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

Saved successfully!

Ooh no, something went wrong!