- numpy - matplotlib Physim

The Unit Vector

In this section you will practice and apply what you have learned from the Unit Vector simulations, creating a calculator to calculate the unit vector given a user input of vector components of a vector in 1, 2, or 3 dimensions and understanding the calculations being done.


If you are looking for a reference for Python consider looking at the Python Reference Sheet on the site.



Below are sample runs of some of the outputs you should get when running the program.


The Unit Vector


For user input choice = 1 and x = 4, the output should be:


For user input choice = 2 and x = 4, y = 3, the output should be:


For user input choice = 2 and x = 5.3, y = -7.4, the output should be:


For user input choice = 3 and x = 11, y = -5, z = 3.7, the output should be:


For user input choice = 3 and x = 3, y = 18, z = 14, the output should be:



Here is a code editor so that you can compute your calculator program.


# insert your code here


Go Back to Vector Exercises Page