Mr. C.'s Add Two Vectors Program

The purpose of this program is to add two vectors that are in polar form.

To add two vectors in polar form, they are each converted to rectangular form and the x and y components of the vectors are then added. This resultant vector in rectangular form is then converted back to polar form.

This problem is number 76 on Page 236 of your Mth113 textbook: "Trigonometry with Applications" 3rd Ed. 1994 by Wesner and Mahler. ISBN 0-697-12292-1.

This program is a combination of HTML and Python. The HTML (this page) is used to collect the user input. This input is passed to a Python script which does the math and outputs the results in HTML so you can see it in your browser. The Python script is written in Python ver. 3.3.0. The Python script is passed to the Python interpreter which is installed on the server that BulldogMath runs on. In general, to run Python this way, you need to have access to a server that has the same version of Python on it that you are using. A more limited way of using Python, much easier for writing and debugging the script, is to install Python on your computer. This allows you to output the program results to the console (aka terminal, aka your screen).

Python is a cool, powerful, and very popular programming language. It is named after Monty Python, not the snake. Python really thinks indents are important. Indented modules must be tabbed or indented 4 spaces. Thou shall not indent three, or two, except when passing to 4. This rule was clearly derived from the Holy Hand Grenade :-)

A pair of vectors to use for testing:
Vector 1 = (13.8, 40.2 degrees)
Vector 2 = (20.9, 164.6 degrees)
Resultant Vector - Rectangular Form = (-9.6, 14.5)
Resultant Vector - Polar Form = (17.4, 123.6 degrees)

Enter Your Two Vectors in Polar Form Here

Note: your input numbers are limited to 20 characters (18 numbers plus the sign, if negative, and a decimal point). Enter only numbers and the decimal point if needed, and the negative sign if needed. The magnitude of the vector has no units, the angle is in degrees.


Vector 1 Magnitude: 
Vector 1 Angle:   degrees

Vector 2 Magnitude: 
Vector 2 Angle:   degrees