Application Center - Maplesoft

App Preview:

Maple adds an “out of this world” touch to math learning

You can switch back to the summary page by clicking here.

Learn about Maple
Download Application


 

Image 

Maple adds an ?out of this world? touch to math learning 

By Tim Chartier, William Bauldry and Sarah Greenwald 

> Typesetting:-mrow(Typesetting:-mi(
 

 

The data files from http://www.davidson.edu/math/chartier/Starwars/ need to be placed in the same directory as the Maple file.  Here we read the data and convert the lists to sequences. 

 

> Typesetting:-mrow(Typesetting:-mi(
 

>
 

> Typesetting:-mrow(Typesetting:-mi(
 

>
 

> Typesetting:-mrow(Typesetting:-mi(
 

>
 

> Typesetting:-mrow(Typesetting:-mi(
 

 

Let's begin with the smaller file and examine the first element: 

> Typesetting:-mrow(Typesetting:-mi(
 

Typesetting:-mrow(Typesetting:-mverbatim(
 

Each data point in polys1 is an array read as 3 rows of [x,y,z] coordinates that form the vertices of 4667 triangles for Yoda, but we want the rotation matrix to act as matrix multiplication.  Here we define rotation by theta about the y-axis. 

> Rot := proc( theta )
 LinearAlgebra:-Transpose( Matrix( [
  [ cos( theta ), 0.0, -sin( theta ) ],
  [ 0, 1, 0 ],
  [ sin( theta ), 0.0, cos( theta ) ] ],
   'datatype' = 'float'[8] ),
   'outputoptions' = [ 'datatype' = 'float'[8] ] )
end proc:
 

 

So we need to Transpose this data so that x,y,z appears as column vectors.  Then we can perform the rotation as matrix multiplication.  Finally, we must change the rotated data back into rows by a Transpose command so that we can tell Maple to connect the vertices with the Polygons plot command.  Another option is to change the order of multiplication, since the transpose of AB is the transpose of B times the transpose of A: 

 

> Typesetting:-mrow(Typesetting:-mi(
 

Typesetting:-mrow(Typesetting:-mverbatim( (1)
 

> Typesetting:-mrow(Typesetting:-mi(
 

> Typesetting:-mrow(Typesetting:-mi(
 

 

Now we plot the original and then the rotated Yoda: 

 

> Typesetting:-mrow(Typesetting:-mi(
 

Plot
 

> Typesetting:-mrow(Typesetting:-mi(
 

Plot
 

The second file: 

> Typesetting:-mrow(Typesetting:-mi(
 

Typesetting:-mrow(Typesetting:-mverbatim(
 

Each data point in polys2 is an array read as 4 rows of [x,y,z] coordinates that form the vertices of 29460 quadrilaterals for Yoda.  We repeat the same process as above and display the plots together. 

> Typesetting:-mrow(Typesetting:-mi(
 

> Typesetting:-mrow(Typesetting:-mi(
 

Plot
 

> Typesetting:-mrow(Typesetting:-mi(
 

Plot
 

You can try Maple's built in rotation ability.  Click on the picture and change the angles. 

Here is the same process repeated with the high resolution data: 

>
 

> Typesetting:-mrow(Typesetting:-mi(
 

>
 

> Typesetting:-mrow(Typesetting:-mi(
 

>
 

> Typesetting:-mrow(Typesetting:-mi(
 

>
 

> Typesetting:-mrow(Typesetting:-mi(
 

> Typesetting:-mrow(Typesetting:-mi(
 

> Typesetting:-mrow(Typesetting:-mi(
 

> Typesetting:-mrow(Typesetting:-mi(
 

Plot
 

> Typesetting:-mrow(Typesetting:-mi(
 

Plot
 


Legal Notice: The copyright for this application is owned by the author(s). Neither Maplesoft nor the author are responsible for any errors contained within and are not liable for any damages resulting from the use of this material. This application is intended for non-commercial, non-profit use only. Contact the author for permission if you wish to use this application in for-profit activities.
 

Image