import math


def gg2gc(gg):
    """transforms coordinates from geographic (lat, lon, h) to geocentric"""


    factor = math.pi/180  # conversion factor from degrees to radians
    r_earth = 6378.135  # earth radius (km) and flatness factor
    g = 1.00673944  # earth flatness factor

    lat = gg[0]*factor
    lon = gg[1]*factor
    h = gg[2]

    hor = (r_earth/math.sqrt(1+math.tan(lat)**2/g)+h*math.cos(lat))
    gc = [hor*math.cos(lon), hor*math.sin(lon), r_earth/math.sqrt(g+g**2/math.tan(lat)**2)+h*math.sin(lat)]

    return gc