Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_azimuth_west(self):
assert azimuth(Point(0, 0), Point(-10, 0)) == 270
def test_azimuth_east(self):
assert azimuth(Point(0, 0), Point(1, 0)) == 90
assert azimuth(Point(0, 0), Point(100, 0)) == 90
def test_azimuth_south(self):
assert azimuth(Point(0, 0), Point(0, -1)) == 180
def test_azimuth_north(self):
assert azimuth(Point(0, 0), Point(0, 1)) == 0
def test_azimuth_southwest(self):
assert azimuth(Point(0, 0), Point(-1, -1)) == 225
def test_azimuth_northwest(self):
assert azimuth(Point(100, 100), Point(99, 101)) == 315
def test_azimuth_northeast(self):
assert azimuth(Point(0, 0), Point(1, 1)) == 45
def compute_angle_between_vectors(self):
p_i = self.traj.df.iloc[self.i][self.traj.get_geom_column_name()]
p_j = self.traj.df.iloc[self.j][self.traj.get_geom_column_name()]
p_k = self.traj.df.iloc[self.k][self.traj.get_geom_column_name()]
azimuth_ij = azimuth(p_i, p_j)
azimuth_jk = azimuth(p_j, p_k)
return angular_difference(azimuth_ij, azimuth_jk)
def compute_angle_between_vectors(self):
p_i = self.traj.df.iloc[self.i][self.traj.get_geom_column_name()]
p_j = self.traj.df.iloc[self.j][self.traj.get_geom_column_name()]
p_k = self.traj.df.iloc[self.k][self.traj.get_geom_column_name()]
azimuth_ij = azimuth(p_i, p_j)
azimuth_jk = azimuth(p_j, p_k)
return angular_difference(azimuth_ij, azimuth_jk)