This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import math | |
| def rotate_vector(v, angle, anchor): | |
| """Rotate a vector `v` by the given angle, relative to the anchor point.""" | |
| x, y = v | |
| x = x - anchor[0] | |
| y = y - anchor[1] | |
| # Here is a compiler optimization; inplace operators are slower than | |
| # non-inplace operators like above. This function gets used a lot, so |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import matplotlib.pyplot as plt | |
| import csv | |
| x=[] | |
| z=[] | |
| f= open("data.csv") | |
| #append values to list | |
| for row in csv.reader(f): | |
| x.append(row[0]) | |
| z.append(row[1]) |
NewerOlder