

def calc_orbital_elements(planet_name, d):
    planet = get_planet(planet_name, d)
    N = planet.get('N')
    i = planet.get('i')
    w = planet.get('w')
    a = planet.get('a')
    e = planet.get('e')
    M = planet.get('M')
    E = (M + ((e * math.sin(M)) * (1.0 + (e * math.cos(M)))))
    xv = (a * (math.cos(E) - e))
    yv = (a * (math.sqrt((1.0 - (e * e))) * math.sin(E)))
    v = math.atan2(yv, xv)
    r = math.sqrt(((planet_name * xv) + (yv * yv)))
    xh = (r * ((math.cos(N) * math.cos((v + w))) - ((math.sin(N) * math.sin((v + w))) * math.cos(i))))
    yh = (r * ((math.sin(N) * math.cos((v + w))) + ((math.cos(N) * math.sin((v + w))) * math.cos(i))))
    zh = (r * (math.sin((v + w)) * math.sin(i)))
    lonecl = math.atan2(yh, xh)
    latecl = math.atan2(zh, math.sqrt(((xh * xh) + (yh * yh))))
    return {
        'r': r,
        'v': v,
        'xh': xh,
        'yh': yh,
        'w': w,
        'lonecl': lonecl,
        'latecl ': latecl,
    }

dataset/ETHPy150Open lhartikk/AstroBuild/astro_build.py calc_orbital_elements/VarMisuse@175/201 `xv`->`planet_name`