def triangle_area(p1, p2, p3):
    """ Calcualate triangle area based on its three vertices.
    """
    # Use Heron's formula to calculate a triangle's area
    # https://www.mathsisfun.com/geometry/herons-formula.html
    a = p1.distance(p2)
    b = p2.distance(p3)
    c = p3.distance(p1)
    s = (a + b + c) / 2
    return (s * (s - a) * (s - b) * (s - c)) ** 0.5