def angle_between_arcs(start_gc1=None, end_gc1=None,
start_gc2=None, end_gc2=None):
# get normal of planes containing great circles
normal_one = np.cross([location_df.loc[start_gc1, "cart_x"],
location_df.loc[start_gc1, "cart_y"],
location_df.loc[start_gc1, "cart_z"]],
[location_df.loc[end_gc1, "cart_x"],
location_df.loc[end_gc1, "cart_y"],
location_df.loc[end_gc1,"cart_z"]])
normal_two = np.cross([location_df.loc[start_gc2, "cart_x"],
location_df.loc[start_gc2, "cart_y"],
location_df.loc[start_gc2, "cart_z"]],
[location_df.loc[end_gc2, "cart_x"],
location_df.loc[end_gc2, "cart_y"],
location_df.loc[end_gc2,"cart_z"]])
# dot product to obtain the angle between the normal planes
angle_between_planes = np.dot(normal_one, normal_two)
# divide by the magnitude of the vectors, inverse of cos to find angle
angle = np.arccos(np.dot(normal_one, normal_two) /
(np.linalg.norm(normal_one) * np.linalg.norm(normal_two)))
obtuse_acute_angle = (np.rad2deg(angle), ((360-(2*np.rad2deg(angle)))/2))
obtuse_angle = np.max(obtuse_acute_angle)
print(f"Acute Angle = {np.min(obtuse_acute_angle)} degrees")
print(f"Obtuse Angle = {np.max(obtuse_acute_angle)} degrees")
return obtuse_acute_angle
gc_aangleNCL function as part of Great Circle functionality (see #131)gc_aanglegc_aangleSee math breakdown