Three Dimensional Coordinate System

Ordered Triples and Distances  in (ℝ^3)

Here is a point in (ℝ^3).

p={1,2,-1}
Show[Graphics3D[{{PointSize[Large],Blue,Point[p]}}],Axes->True,AxesLabel->{"x","y","z"}]

In Mathematica, you access the components of a vector using two square brackets:

p[[1]]
p[[2]]
p[[3]]

The distance between two points is given by the distance formula:

p={1,2,-1}
q={1,3,4}
points=Show[Graphics3D[{{PointSize[Large],Blue,Point[p]},{PointSize[Large],Red,Point[q]}}]];
distance=(Sqrt[(((p[[1]]-q[[1]]))^2)+(((p[[2]]-q[[2]]))^2)+(((p[[3]]-q[[3]]))^2)])

line=Show[Graphics3D[{Black,Line[{p,q}]}]];

Show[points,line,Axes->True,AxesLabel->{"x","y","z"}]

Surfaces in (ℝ^3)

We know that in (ℝ^2) the equation y=x represents a line passing through the origin with slope 1.

Here is the set of points under the restriction that y=x when we are in (ℝ^3):

list=Table[Point[{x,x,z}],{x,-2,2,0.2},{z,-2,2,0.2}];

Show[Graphics3D[{{PointSize[Large],Blue,list}}],Axes->True,AxesLabel->{"x","y","z"}]

We see that y=x is actually a plane in (ℝ^3), but y=x is a line in (ℝ^2). Obviously, the dimension we are working in affects the type of object we get!

Here is the set of points that satisfy x=-3:

list=Table[Point[{-3,y,z}],{y,-2,2,0.2},{z,-2,2,0.2}];

Show[Graphics3D[{{PointSize[Large],Blue,list}}],Axes->True,AxesLabel->{"x","y","z"}]

Here is a more complicated example, for z=(x^2)-(y^2):

list=Table[Point[{x,y,(x^2)-(y^2)}],{x,-2,2,0.1},{y,-2,2,0.1}];

Show[Graphics3D[{{PointSize[Medium],Blue,list}}],Axes->True,AxesLabel->{"x","y","z"}]

In (ℝ^3), the graph of a equation involving x,y,z will be a surface.

Some Special Surfaces

We don't need to plot points, we can use other built-in commands to produce plots easily.

Plot the region bounded by (x^2)+(y^2)≤ (r^2)(a cylinder) for r=4:

RegionPlot3D[(x^2)+(y^2)≤(4^2),{x,-6,6},{y,-6,6},{z,-6,6},Axes->True,AxesLabel->{"x","y","z"}]

Notice that since we had an inequality, we have a solid cylinder (all the points inside the cylinder also satisfy the inequality (x^2)+(y^2)≤ (r^2)).

Consider the surface (((x-(Subscript[x, 0])))^2)+(((y-(Subscript[y, 0])))^2)+(((z-(Subscript[z, 0])))^2) = (r^2) for (Subscript[x, 0])=1,(Subscript[y, 0])=2,(Subscript[z, 0])=-3,r=4. We can plot this a couple of ways. One is to solve for z and plot the top and bottom separately:

top=Plot3D[
-3+(Sqrt[(4^2)- (((x-1))^2)-(((y-2))^2)]),
{x,-7,7},{y,-7,7},
 Axes->True,AxesLabel->{"x","y","z"}]

bottom=Plot3D[
-3-(Sqrt[(4^2)- (((x-1))^2)-(((y-2))^2)]),
{x,-7,7},{y,-7,7}, 
Axes->True,AxesLabel->{"x","y","z"}]

Show[top,bottom,PlotRange->{{-7,7},{-7,7},{-7,7}},AspectRatio->1]

We'll see a better way using a parameterization later on.

We can also plot the region that is represented by the following conditions:
(((x-2))^2)+(((y-1))^2)+(z^2) ≤ 5
(x^2)+(y^2)+(z^2)≤6

RegionPlot3D[
(((x-2))^2)+(((y-1))^2)+(z^2)≤5&&(x^2)+(y^2)+(z^2)<6,
{x,-4,4},{y,-4,4},{z,-4,4},
Axes->True,AxesLabel->{"x","y","z"},PlotPoints->36]

The symbol && means "and". The symbol || means "or":

RegionPlot3D[
(((x-2))^2)+(((y-1))^2)+(z^2)≤5||(x^2)+(y^2)+(z^2)<6,
{x,-5,5},{y,-5,5},{z,-5,5},
Axes->True,AxesLabel->{"x","y","z"},PlotPoints->36]

Coordinate Planes

We saw the following plane before:

list=Table[Point[{x,x,z}],{x,-2,2,0.2},{z,-2,2,0.2}];

Show[Graphics3D[{{PointSize[Large],Blue,list}}],Axes->True,AxesLabel->{"x","y","z"}]

Here is an example of the plane y=x in cartesian coordinates, using the ParametricPlot3D command:

plot1=ParametricPlot3D[{x,x,z},{x,-1,1},{z,-1,1},Axes->True,AxesLabel->{"x","y","z"}]

plotxyplane=ParametricPlot3D[{x,y,0},{x,-1,1},{y,-1,1},Axes->True,AxesLabel->{"x","y","z"}]

plotxzplane=ParametricPlot3D[{x,0,z},{x,-1,1},{z,-1,1},Axes->True,AxesLabel->{"x","y","z"}]

plotyzplane=ParametricPlot3D[{0,y,z},{y,-1,1},{z,-1,1},Axes->True,AxesLabel->{"x","y","z"}]

Show[plotxyplane,plotxzplane,plotyzplane]