import math


def calculate_angle(a, b, c):
    """
    Returns angle (a-b-c), in degrees

    All points are assumed to be locintel.core.datamodel.geo.GeoCoordinate objects
    """
    b_c = math.sqrt((b.lng - c.lng) ** 2 + (b.lat - c.lat) ** 2)
    a_c = math.sqrt((a.lng - c.lng) ** 2 + (a.lat - c.lat) ** 2)
    a_b = math.sqrt((a.lng - b.lng) ** 2 + (a.lat - b.lat) ** 2)
    formula = (b_c ** 2.0 + a_c ** 2.0 - a_b ** 2.0) / (2.0 * b_c * a_c)
    formula = -1.0 if formula < -1.0 else formula
    formula = 1.0 if formula > 1.0 else formula
    return (math.acos(formula) * 180.0) / math.pi