#!/usr/bin/env python # coding: utf-8 # # Practice Problems # ### Lecture 22 # Answer each number in a separate cell # # Rename the notebook with your lastName, first initial and the lecture # # ex. Cych_B_22 # # Turn this notebook into Canvas # ## 1. Cartesian coordinates and polar coordinates # - Write lambda functions to replace dir2cart() and cart2dir(). Call them **dir_cart** and **cart_dir** # - You measured a bedding plane with an azimuth of 40 and a plunge of 62. Use your function **dir_cart()** to convert the coordinates to cartesian coordinates. # - Use your function **cart_dir()** to convert the cartesian coordinates back to polar coordinates # - test your functions by calling the **dir2cart()** and **cart2dir()** functions in the lecture. # - modify **cart2dir()** to round to the nearest decimal # # ## 2. Unit vectors # - What is the sum of the two vectors Az1=245, Pl1=22 and Az2=10, Pl2=60? # - What is the difference between these vectors? # - What is angle between the two vectors? # - What is pole to the two vectors? # - Make an equal angle diagram # - plot the two vectors as green triangles # - plot the pole to the plane as a blue star # # ## 3. Vectors with length # - Modify the function **dir2cart()** from the lecture to include vector length $R$. Call it **vec2cart()**. # - Apply your new function to evaluate the cartesian coordinates of the vector with Azimuth=12, Plunge=42, R=8 # - Modify the function **cart2dir()** to return the full vector (Azimuth, Plunge and $R$) from the cartesian coordinates. Call this one **cart2vec()**. # - Verify that your function works, by feeding the output of **dir2cart()** back into **cart2dir()** to make sure you get back what you started with. # # # In[ ]: