Part A: Python as a calculator
Exercises
Some of the following questions require you to look up operations
that we did not cover in the lab notes.
The goal here is to learn
how to locate information about Python and its packages.
- Familiarize yourself with using the iPython shell and the
Python interpreter. Try out simple
arithmetic expressions using the operations given in the tutorial.
-
Evaluate the function sin(x) / x at x = 3.3,
1.2, and .1.
-
Evaluate this function at x = 0.0. How does the interpreter react to errors?
-
Can you calculate the angle whose tangent is 1/3 with the
function atan(1/3). Why or why not?
-
What is the modulus of the complex number 3.5 + 5j?
- Make sure you can run the example program given in the lab notes.
Modify it to include printing
-
the triangle's center of mass;
-
the triangle's three angles; and
-
the normal vector of the plane defined by the triangle.
Table of Contents