def curvature(i, j): # Computes the curvature of the clothoid x0, x1 = [s[i], s[j]] y0, y1 = [z[i], z[j]] tht0, tht1 = [0, 0] k, K, L = clothoid.build_clothoid(x0, y0, tht0, x1, y1, tht1) extremal_curvatures = [k + L * K, k] return max(np.absolute(extremal_curvatures))
def test_land_elevations_pair_v1(self, elevation_a, arc_length_a, elevation_b, arc_length_b): theta_0 = 0 theta_1 = 0 start_curvature, curvature_per_length, length = \ clothoid.build_clothoid(arc_length_a, elevation_a, theta_0, arc_length_b, elevation_b, theta_1) extremal_curvatures = [start_curvature, start_curvature + length * curvature_per_length] largest_curvature = max(np.absolute(extremal_curvatures)) is_elevation_pair_valid = largest_curvature < self.max_curvature return is_elevation_pair_valid