SUNY Geneseo Department of Mathematics

Introduction to Mathematica

Friday, August 31

Math 223 01
Fall 2018
Prof. Doug Baldwin

Return to Course Outline

Previous Lecture

Questions?

Spheres

The problem we ended with last time: do the spheres (x-1)2 + (y+1)2 + z2 = 9 and x2 + (y-1)2 + (z-1)2 = 16 overlap?

Key idea: if the distance between the centers of the spheres is less than the sum of the radii then the spheres overlap.

You can read the coordinates of the centers, and the radii, from the equations: The x, y, and z center coordinates are the constants subtracted from x, y, and z in the equations; the square of the radius is the constant on the right side of the equation.

Take-Aways: The equation for a sphere and how to interpret its parts.

Introduction to Mathematica

Mathematica as a Calculator

Do the calculations for the sphere problem.

You can write arithmetic in Mathematica using more or less standard notation (e.g., +, -, parentheses, etc.) But beware that multiplication is “*” and exponentiation is “^” and division is “/”.

Mathematica also has almost every common mathematical function (sine, cosine, square root, etc.) built in. Built in function names always start with a capital letter. Arguments go inside square brackets, i.e., “[” and “]”, rather than parentheses.

Type math or plain text (for notes) in response to Mathematica’s horizontal line prompt.

To tell Mathematica to evaluate an expression or command, press the shift and enter keys together.

Using these ideas, we can get Mathematica to calculate the distance between the spheres from today’s first problem. It turns out to be √6, which is less than either radius, so the spheres overlap.

Plotting Implicit Surfaces

Plot implicit surfaces (i.e., surfaces defined as solutions to an equation such as x2 + y2 + z2 = 9 rather than by giving one variable as an explicit function of the others as in z = x2 + y2) with the ContourPlot3D function.

Try this out, to plot...

Take-Aways

Basic Mathematica command conventions.

The ContourPlot3D function for plotting implicit surfaces.

Here is the Mathematica “notebook” from our session today. Open it in Mathematica to see the exact commands we gave and results we got.

Documentation on Mathematica and its functions is at https://reference.wolfram.com/language/

Problem Set

On 3D space, Mathematica, and quadrics.

See handout for details.

Next

Cylinders and quadric surfaces.

Read section 2.6

Next Lecture