Vector Presentation
Transcript: Vector mapping project Intro We used the Belknap academic building and ekstrom library as our two locations. we measured the vectors using skills learned from this class . Path 1 Path 1 The first path we established, labeled 1 with each vector associated by alphabetical character. Leaving the Academic building from the North-Eastern door and walking a straight path for 613.48 ft using Google Maps set to view a satellite image set to north being the y-axis. We took a screen shot on the path and posted it to our One Note file to use its compass to measure the angle of the first vector in Path 1, we labeled this vector 1a. At the end of vector 1a we measured the distance for 1b. At the tip of vector 1a begins the origin of 1b. Path 1b is a vector with magnitude of 906.38 ft at an angle of 172 degrees measured using North as a y-axis on Google Maps. Finally, Vector 1c of Path 1 was oriented at the end of vector 1b. Using North on google maps as a reference of the y-axis we measured 1c to have a magnitude of 328.58 ft at an angle of 270 degrees. Path 2 path 2 Our second path, labeled Path 2 took what we considered to be the more direct route. Both paths 1 and 2 started at what we considered the same origin. We felt that using different doors was acceptable considering that the whole building was what we were call this origin. Starting Path 2 began at the western entrance to the building. Using the method of measuring distance and angles as described previously, vector 2a had a magnitude of 413.27 ft and measuring angle of 172 degrees referencing north on google maps as our y-axis. Vector 2b begins where vector 2a ended, with a magnitude of 306.50 ft and an angle of 83 degrees. Vector 2c the final vector of Path 2 measured at an angle of 154 degrees and with magnitude of 214.84 ft. programming programming Our team developed a program using the Python Idle 3.9.1 to compute the data that we recorded. We first needed to let the program know that we were going to be asking it to do some calculations. So, we used the “import math” to allow it to understand and help us with calculations. Now that the program understand the math functions we'll be using, we added input for the user to identify the type of calculation they would like to perform. Now we needed to let our program know how to keep a memory of our range of possible inputs. Using the “tmpList” function gave our program a memory. This allowed the user to input as many vectors as they wished for the program to convert. Our “If-else if” statement allowed the user to input and assign variables to what we were later going to ask the program to compute. By assigning inputs with a float attached gives the user the ability to use decimals when defining variables. Finally, in both the “if” and the “elif” statements end using a “tmpList.append (xxxx)” where the xxxx is what we asked the program to remember and how to format it. Programming (cont.) programming (cont.) Now that we have asked the program to do a task, we need to teach it what we mean when asking to perform said task. With out being specific in each of these functions we could confuse the program and have errors. When writing a definition of a function we needed to give the function a through function that lets the program know what inputs to use in the function that we defined. “displace = math.sqrt((tmpX ** 2) + (tmpY ** 2))” this is simply the Pythagorean Theorem, a great example of the difference between how we usually use math and how our program sees math. programming (cont.) Programming (cont.) To review, we have shown the program how to ask the question that we are teaching it and we have defined all functions and variable its needs to solve the questions. This is our “main” function. Our main function is the work horse of the program. In the picture, the main function is shown as a visual aid of all the functions we defined, how we told the program to compute each function, and how to associate the functions. Also shown in the figure is how we added in text to explain to the user what exactly was computed. This helps clarify the results. Programming (cont.) programming (cont.) Once we finished our coding, we tested it to show that it was working properly. Using our understanding of Polar and Cartesian coordinates we asked the program to perform a up 1 unit and left 1 unit, using vector addition and the definition Pythagorean Theorem. To prove this is the accurate calculation we checked that the program answered with the decimal value of the equation we used that’s equal to 1.414. We asked the program to round the second decimal place using the round function (xxxx, 2); where xxxx is the variable we asked it to round for us. The program was behaving correctly, we explained to it we were going to ask it a range of questions, and taught it how to handle all possible inputs. Now to show our program performing the exact calculations. first successful test. exact calculations Excel excel After we mapped