import math


def getTriangleVertices(latitude, longitude, heading, rangeAngle):
    """Return list of vertices of the isocelees triangle given lat/long as one vertex
       and heading/rangeAngle specifying the angle to the other vertices.

    Args:
        latitude (float): latitude of central vertex
        longitude (float): longitude of central vertex
        heading (int): direction of the central angle
        rangeAngle (int): degrees (size) of the central angle

    Returns:
        List of all vertices in [lat,long] format
    """
    distanceDegrees = 0.6 # approx 40 miles

    vertices = [[latitude, longitude]]
    angle = 90 - heading
    minAngle = (angle - rangeAngle/2) % 360
    maxAngle = (angle + rangeAngle/2) % 360

    p0Lat = latitude + math.sin(minAngle*math.pi/180)*distanceDegrees
    p0Long = longitude + math.cos(minAngle*math.pi/180)*distanceDegrees
    vertices.append([p0Lat, p0Long])

    p1Lat = latitude + math.sin(maxAngle*math.pi/180)*distanceDegrees
    p1Long = longitude + math.cos(maxAngle*math.pi/180)*distanceDegrees
    vertices.append([p1Lat, p1Long])
    return vertices