{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# class30 - PHYS 5900 Class 30 Fri Zi-Wei Lin 3.5.3...

This preview shows pages 1–8. Sign up to view the full content.

PHYS 5900 Class 30 (11/13/2009 Fri) Zi-Wei Lin 3.5.3 Three-Dimensional Graphics Three-Dimensional Graphics Primitives include Cuboid[ ], Cylinder[ ], GraphicsComplex[ ], Line[ ], Point[ ], Polygon[ ], Sphere[ ], Text[ ] In[1]:= ?Cuboid Cuboid @8 x min , y min , z min <D is a three - dimensional graphics primitive that represents a unit cuboid, oriented parallel to the axes. Cuboid @8 x min , y min , z min < , 8 x max , y max , z max <D specifies a cuboid by giving the coordinates of opposite corners. Mathematica encloses 3-d graphics within a cuboidal box: In[2]:= ?Sphere Sphere @8 x , y , z < , r D represents a sphere of radius r centered at H x , y , z L . Sphere @8 x , y , z <D represents a sphere of radius 1. Sphere @88 x 1 , y 1 , z 1 < , 8 x 2 , y 2 , z 2 < , < , r D represents a collection of spheres of radius r .

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
In[3]:= Graphics3D @ Sphere @8 0, 0, 1 <DD Out[3]= In[4]:= Graphics3D @ Cuboid @8 0.5, 0.5, 0.5 < , 8 1, 1, 1 <DD Out[4]= 2 class30.nb
Use " Boxed fi False " to remove the cuboidal box : In[5]:= Graphics3D @ Cuboid @8 0.5, 0.5, 0.5 < , 8 1, 1, 1 <D , Boxed fi False D Out[5]= class30.nb 3

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Coordinates of 3D graphics primitives can be in absolute or relative coordinates; for relative coordinates: values in Scaled[{sx,sy,sz}] are from 0 to 1. In[6]:= Graphics3D @8 Cuboid @8 0.5, 0.5, 0.5 < , 8 1, 1, 1 <D , Cuboid @ Scaled @8 0.5, 0.5, 0.5 <D , Scaled @8 1, 1, 1 <DD , Dashing @ 0.02 D , Line @ 888 a, a, 0 < , 8 a, a, a << , 88 a, a, 0 < , 8 a, 0, 0 << , 88 a, a, 0 < , 8 0, a, 0 <<< . a fi 0.5 D < , PlotRange fi 88 0, 2 < , 8 0, 2 < , 8 0, 2 << , Axes fi True, AxesLabel fi 8 "x", "y", "z" <D Out[6]= 0.0 0.5 1.0 1.5 2.0 x 0.0 0.5 1.0 1.5 2.0 y 0.0 0.5 1.0 1.5 2.0 z In[7]:= ?Polygon Polygon @8 pt 1 , pt 2 , <D is a graphics primitive that represents a filled polygon. Polygon @88 pt 11 , pt 12 , < , 8 pt 21 , < , <D represents a collection of polygons. 4 class30.nb
The following polygon lies in one plane: In[8]:= Graphics3D @ Polygon @88 - 1, - 1, 0 < , 8 - 1, 1, 0 < , 8 1, 1, 0 < , 8 1, - 1, 0 < , 8 0.5, - 2, 0 < , 8 - 0.5, - 2, 0 <<D , Axes fi True, AxesLabel fi 8 "x", "y", "z" <D Out[8]= - 1.0 - 0.5 0.0 0.5 1.0 x - 2 - 1 0 1 y - 1.0 - 0.5 0.0 0.5 1.0 z class30.nb 5

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
The following polygon is not convex at all corners: In[9]:= Graphics3D @ Polygon @88 - 1, - 1, 0 < , 8 - 1, 1, 0 < , 8 1, 1, 0 < , 8 1, - 1, 0 < , 8 0.5, 0, 0 < , 8 - 0.5, 0, 0 <<DD Out[9]= The following polygon does not lie in one plane: In[10]:= Graphics3D @ Polygon @88 - 1, - 1, 0 < , 8 - 1, 1, 0 < , 8 1, 1, 0 < , 8 1, - 1, 0 < , 8 0.5, 0, 1 < , 8 - 0.5, 0, 1 <<D , Axes fi True, AxesLabel fi 8 "x", "y", "z" <D Out[10]= - 1.0 - 0.5 0.0 0.5 1.0 x - 1.0 - 0.5 0.0 0.5 1.0 y 0.0 0.5 1.0 z 6 class30.nb
In 2-dimensional graphics, graphics rendered later covers those rendered earlier. This is not the case for 3-dimensional graphics, where graphics in the front covers those in the back.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 23

class30 - PHYS 5900 Class 30 Fri Zi-Wei Lin 3.5.3...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online