#    Copyright (C) 2021 by Kevin D. Woerner
##-# =KDW= ################# BUILDER $KWROOT/0lib/vkkcp.sh ##################
##-# =KDW= ######### SOURCE $KWROOT/codekdw/kw-lib/Kwplanets.fwipp ##########
##-# =KDW= #### THIS FILE CAN BE OVERWRITTEN BY KEVIN D. WOERNER OR HIS #####
##-# =KDW= ############ MINIONS AT *ANY* TIME. Caveat utilitor. #############
# 2021-05-14 kdw  For Changelog, See File varylog
import sys
import math
import time
import Kw
import Kwelements
SUN_GM = 1.32712440018E+20 * Kw.UNITGM
SUN_YEAR = 0.0 * Kw.DAY
SUN_DAY = 24.47 * Kw.DAY
MERCURY_GM = 2.2032E+13 * Kw.UNITGM
MERCURY_YEAR = 87.9691 * Kw.DAY
MERCURY_DAY = 58.6462 * Kw.DAY
VENUS_GM = 3.24859E+14 * Kw.UNITGM
VENUS_YEAR = 224.701 * Kw.DAY
VENUS_DAY = -243.018 * Kw.DAY
MARS_GM = 4.282837E+13 * Kw.UNITGM
MARS_YEAR = 686.971 * Kw.DAY
MARS_DAY = 1.02595676 * Kw.DAY
EARTH_GM = 3.986004418E+14 * Kw.UNITGM
EARTH_YEAR = 365.256363004 * Kw.DAY
EARTH_DAY = 1.0 / 1.00273781191135448 * Kw.DAY
JUPITER_GM = 1.26686534E+17 * Kw.UNITGM
JUPITER_YEAR = 4332.59 * Kw.DAY
JUPITER_DAY = 0.41354 * Kw.DAY
SATURN_GM = 3.7931187E+16 * Kw.UNITGM
SATURN_YEAR = 10759.22 * Kw.DAY
SATURN_DAY = 0.44401 * Kw.DAY
URANUS_GM = 5.793939E+15 * Kw.UNITGM
URANUS_YEAR = 30688.5 * Kw.DAY
URANUS_DAY = -0.71833 * Kw.DAY
NEPTUNE_GM = 6.836529E+15 * Kw.UNITGM
NEPTUNE_YEAR = 6.0182E+4 * Kw.DAY
NEPTUNE_DAY = 0.67125 * Kw.DAY
PLUTO_GM = 8.71E+11 * Kw.UNITGM
PLUTO_YEAR = 9.056E+4 * Kw.DAY
PLUTO_DAY = 6.38723 * Kw.DAY
MOON_GM = 4.9048695E+12 * Kw.UNITGM
MOON_YEAR = 27.32166155 * Kw.DAY
MOON_DAY = 27.321661 * Kw.DAY
CERES_GM = 6.26325E+10 * Kw.UNITGM
CERES_YEAR = 1681.63 * Kw.DAY
CERES_DAY = 0.378090 * Kw.DAY
ERIS_GM = 1.108E+12 * Kw.UNITGM
ERIS_YEAR = 2.0383E+5 * Kw.DAY
ERIS_DAY = 1.0792 * Kw.DAY
MAKEMAKE_GM = 2.9366E+11 * Kw.UNITGM
MAKEMAKE_YEAR = 1.12897E+5 * Kw.DAY
MAKEMAKE_DAY = 0.32379 * Kw.DAY
HAUMEA_GM = 2.674E+11 * Kw.UNITGM
HAUMEA_YEAR = 1.03774E+5 * Kw.DAY
HAUMEA_DAY = 0.16314585 * Kw.DAY
EARTH_SOLARDAY = Kw.DAY
EARTH_SIDEREALDAY = Kw.DAY / 1.002737909350795
EARTH_STELLARDAY = EARTH_DAY
EARTH_TROPICALYEAR = 365.242190402 * Kw.DAY
EARTH_SIDEREALYEAR = EARTH_YEAR
EARTH_ANOMALISTICYEAR = 365.259636 * Kw.DAY
SIDEREALYEAR = EARTH_SIDEREALYEAR
ANOMALISTICYEAR = EARTH_ANOMALISTICYEAR
TROPICALYEAR = EARTH_TROPICALYEAR
SUN_FLATNESS = 9.0E-6
SUN_A = 6.957E+8 * Kw.METER
SUN_C = SUN_A
MERCURY_FLATNESS = 0.0
MERCURY_A = 2.4397E+6 * Kw.METER
MERCURY_C = MERCURY_A
VENUS_FLATNESS = 0.0
VENUS_A = 6.0518E+6 * Kw.METER
VENUS_C = VENUS_A
EARTH_FLATNESS = 1.0 / 298.257223563
EARTH_A = 6.378137E+6 * Kw.METER
EARTH_C = EARTH_A
MARS_FLATNESS = 1.0 / 169.81
MARS_A = 3.3962E+6 * Kw.METER
MARS_C = MARS_A
JUPITER_FLATNESS = 1.0 / 15.4144028
JUPITER_A = 7.1492E+7 * Kw.METER
JUPITER_C = JUPITER_A
SATURN_FLATNESS = 1.0 / 10.208
SATURN_A = 6.0268E+7 * Kw.METER
SATURN_C = SATURN_A
URANUS_FLATNESS = 1.0 / 43.61604
URANUS_A = 2.5559E+7 * Kw.METER
URANUS_C = URANUS_A
NEPTUNE_FLATNESS = 1.0 / 58.54373
NEPTUNE_A = 2.4764E+7 * Kw.METER
NEPTUNE_C = NEPTUNE_A
PLUTO_FLATNESS = 0.0
PLUTO_A = 1.1899E+6 * Kw.METER
PLUTO_C = PLUTO_A
MOON_FLATNESS = 1.0 / 827.667
MOON_A = 1.7381E+6 * Kw.METER
MOON_C = MOON_A
CERES_FLATNESS = 1.0 / 13.0432
CERES_A = 4.826E+5 * Kw.METER
CERES_C = 4.806E+5 * Kw.METER
ERIS_FLATNESS = 0.0
ERIS_A = 1.163E+6 * Kw.METER
ERIS_C = ERIS_A
MAKEMAKE_FLATNESS = 1.0 / 30.7917
MAKEMAKE_A = 7.39E+5 * Kw.METER
MAKEMAKE_C = MAKEMAKE_A
HAUMEA_FLATNESS = 1.0 / 1.96115
HAUMEA_A = 1.161E+6 * Kw.METER
HAUMEA_C = 8.52E+5 * Kw.METER
SUN_B = SUN_A * (1.0 - SUN_FLATNESS)
SUN_RADIUS = (SUN_A + SUN_B + SUN_C) / 3.0
SUN_ESCAPE = math.sqrt(2.0 * SUN_GM / SUN_RADIUS)
SUN_OBLATENESS = math.sqrt(SUN_FLATNESS * (2.0 - SUN_FLATNESS))
SUN_GRAVITY = SUN_GM / (SUN_RADIUS * SUN_RADIUS)
SUN_MASS = SUN_GM / Kw.GRAVITATION
SUN_VOLUME = 2.0 * Kw.TAU / 3.0 * SUN_RADIUS * SUN_RADIUS * SUN_RADIUS
SUN_SURFACE = 2.0 * Kw.TAU * SUN_RADIUS * SUN_RADIUS
SUN_DENSITY = SUN_MASS / SUN_VOLUME
EARTH_B = EARTH_A * (1.0 - EARTH_FLATNESS)
EARTH_RADIUS = (EARTH_A + EARTH_B + EARTH_C) / 3.0
EARTH_ESCAPE = math.sqrt(2.0 * EARTH_GM / EARTH_RADIUS)
EARTH_OBLATENESS = math.sqrt(EARTH_FLATNESS * (2.0 - EARTH_FLATNESS))
EARTH_GRAVITY = EARTH_GM / (EARTH_RADIUS * EARTH_RADIUS)
EARTH_MASS = EARTH_GM / Kw.GRAVITATION
EARTH_VOLUME = 2.0 * Kw.TAU / 3.0 * EARTH_RADIUS * EARTH_RADIUS *\
         EARTH_RADIUS
EARTH_SURFACE = 2.0 * Kw.TAU * EARTH_RADIUS * EARTH_RADIUS
EARTH_DENSITY = EARTH_MASS / EARTH_VOLUME
MERCURY_B = MERCURY_A * (1.0 - MERCURY_FLATNESS)
MERCURY_RADIUS = (MERCURY_A + MERCURY_B + MERCURY_C) / 3.0
MERCURY_ESCAPE = math.sqrt(2.0 * MERCURY_GM / MERCURY_RADIUS)
MERCURY_OBLATENESS = math.sqrt(MERCURY_FLATNESS * (2.0 - MERCURY_FLATNESS))
MERCURY_GRAVITY = MERCURY_GM / (MERCURY_RADIUS * MERCURY_RADIUS)
MERCURY_MASS = MERCURY_GM / Kw.GRAVITATION
MERCURY_VOLUME = 2.0 * Kw.TAU / 3.0 * MERCURY_RADIUS * MERCURY_RADIUS *\
         MERCURY_RADIUS
MERCURY_SURFACE = 2.0 * Kw.TAU * MERCURY_RADIUS * MERCURY_RADIUS
MERCURY_DENSITY = MERCURY_MASS / MERCURY_VOLUME
MERCURY_SYNODIC = EARTH_SIDEREALYEAR * MERCURY_YEAR / (MERCURY_YEAR -\
         EARTH_SIDEREALYEAR)
VENUS_B = VENUS_A * (1.0 - VENUS_FLATNESS)
VENUS_RADIUS = (VENUS_A + VENUS_B + VENUS_C) / 3.0
VENUS_ESCAPE = math.sqrt(2.0 * VENUS_GM / VENUS_RADIUS)
VENUS_OBLATENESS = math.sqrt(VENUS_FLATNESS * (2.0 - VENUS_FLATNESS))
VENUS_GRAVITY = VENUS_GM / (VENUS_RADIUS * VENUS_RADIUS)
VENUS_MASS = VENUS_GM / Kw.GRAVITATION
VENUS_VOLUME = 2.0 * Kw.TAU / 3.0 * VENUS_RADIUS * VENUS_RADIUS *\
         VENUS_RADIUS
VENUS_SURFACE = 2.0 * Kw.TAU * VENUS_RADIUS * VENUS_RADIUS
VENUS_DENSITY = VENUS_MASS / VENUS_VOLUME
VENUS_SYNODIC = EARTH_SIDEREALYEAR * VENUS_YEAR / (VENUS_YEAR -\
         EARTH_SIDEREALYEAR)
MARS_B = MARS_A * (1.0 - MARS_FLATNESS)
MARS_RADIUS = (MARS_A + MARS_B + MARS_C) / 3.0
MARS_ESCAPE = math.sqrt(2.0 * MARS_GM / MARS_RADIUS)
MARS_OBLATENESS = math.sqrt(MARS_FLATNESS * (2.0 - MARS_FLATNESS))
MARS_GRAVITY = MARS_GM / (MARS_RADIUS * MARS_RADIUS)
MARS_MASS = MARS_GM / Kw.GRAVITATION
MARS_VOLUME = 2.0 * Kw.TAU / 3.0 * MARS_RADIUS * MARS_RADIUS * MARS_RADIUS
MARS_SURFACE = 2.0 * Kw.TAU * MARS_RADIUS * MARS_RADIUS
MARS_DENSITY = MARS_MASS / MARS_VOLUME
MARS_SYNODIC = EARTH_SIDEREALYEAR * MARS_YEAR / (MARS_YEAR -\
         EARTH_SIDEREALYEAR)
JUPITER_B = JUPITER_A * (1.0 - JUPITER_FLATNESS)
JUPITER_RADIUS = (JUPITER_A + JUPITER_B + JUPITER_C) / 3.0
JUPITER_ESCAPE = math.sqrt(2.0 * JUPITER_GM / JUPITER_RADIUS)
JUPITER_OBLATENESS = math.sqrt(JUPITER_FLATNESS * (2.0 - JUPITER_FLATNESS))
JUPITER_GRAVITY = JUPITER_GM / (JUPITER_RADIUS * JUPITER_RADIUS)
JUPITER_MASS = JUPITER_GM / Kw.GRAVITATION
JUPITER_VOLUME = 2.0 * Kw.TAU / 3.0 * JUPITER_RADIUS * JUPITER_RADIUS *\
         JUPITER_RADIUS
JUPITER_SURFACE = 2.0 * Kw.TAU * JUPITER_RADIUS * JUPITER_RADIUS
JUPITER_DENSITY = JUPITER_MASS / JUPITER_VOLUME
JUPITER_SYNODIC = EARTH_SIDEREALYEAR * JUPITER_YEAR / (JUPITER_YEAR -\
         EARTH_SIDEREALYEAR)
SATURN_B = SATURN_A * (1.0 - SATURN_FLATNESS)
SATURN_RADIUS = (SATURN_A + SATURN_B + SATURN_C) / 3.0
SATURN_ESCAPE = math.sqrt(2.0 * SATURN_GM / SATURN_RADIUS)
SATURN_OBLATENESS = math.sqrt(SATURN_FLATNESS * (2.0 - SATURN_FLATNESS))
SATURN_GRAVITY = SATURN_GM / (SATURN_RADIUS * SATURN_RADIUS)
SATURN_MASS = SATURN_GM / Kw.GRAVITATION
SATURN_VOLUME = 2.0 * Kw.TAU / 3.0 * SATURN_RADIUS * SATURN_RADIUS *\
         SATURN_RADIUS
SATURN_SURFACE = 2.0 * Kw.TAU * SATURN_RADIUS * SATURN_RADIUS
SATURN_DENSITY = SATURN_MASS / SATURN_VOLUME
SATURN_SYNODIC = EARTH_SIDEREALYEAR * SATURN_YEAR / (SATURN_YEAR -\
         EARTH_SIDEREALYEAR)
URANUS_B = URANUS_A * (1.0 - URANUS_FLATNESS)
URANUS_RADIUS = (URANUS_A + URANUS_B + URANUS_C) / 3.0
URANUS_ESCAPE = math.sqrt(2.0 * URANUS_GM / URANUS_RADIUS)
URANUS_OBLATENESS = math.sqrt(URANUS_FLATNESS * (2.0 - URANUS_FLATNESS))
URANUS_GRAVITY = URANUS_GM / (URANUS_RADIUS * URANUS_RADIUS)
URANUS_MASS = URANUS_GM / Kw.GRAVITATION
URANUS_VOLUME = 2.0 * Kw.TAU / 3.0 * URANUS_RADIUS * URANUS_RADIUS *\
         URANUS_RADIUS
URANUS_SURFACE = 2.0 * Kw.TAU * URANUS_RADIUS * URANUS_RADIUS
URANUS_DENSITY = URANUS_MASS / URANUS_VOLUME
URANUS_SYNODIC = EARTH_SIDEREALYEAR * URANUS_YEAR / (URANUS_YEAR -\
         EARTH_SIDEREALYEAR)
NEPTUNE_B = NEPTUNE_A * (1.0 - NEPTUNE_FLATNESS)
NEPTUNE_RADIUS = (NEPTUNE_A + NEPTUNE_B + NEPTUNE_C) / 3.0
NEPTUNE_ESCAPE = math.sqrt(2.0 * NEPTUNE_GM / NEPTUNE_RADIUS)
NEPTUNE_OBLATENESS = math.sqrt(NEPTUNE_FLATNESS * (2.0 - NEPTUNE_FLATNESS))
NEPTUNE_GRAVITY = NEPTUNE_GM / (NEPTUNE_RADIUS * NEPTUNE_RADIUS)
NEPTUNE_MASS = NEPTUNE_GM / Kw.GRAVITATION
NEPTUNE_VOLUME = 2.0 * Kw.TAU / 3.0 * NEPTUNE_RADIUS * NEPTUNE_RADIUS *\
         NEPTUNE_RADIUS
NEPTUNE_SURFACE = 2.0 * Kw.TAU * NEPTUNE_RADIUS * NEPTUNE_RADIUS
NEPTUNE_DENSITY = NEPTUNE_MASS / NEPTUNE_VOLUME
NEPTUNE_SYNODIC = EARTH_SIDEREALYEAR * NEPTUNE_YEAR / (NEPTUNE_YEAR -\
         EARTH_SIDEREALYEAR)
PLUTO_B = PLUTO_A * (1.0 - PLUTO_FLATNESS)
PLUTO_RADIUS = (PLUTO_A + PLUTO_B + PLUTO_C) / 3.0
PLUTO_ESCAPE = math.sqrt(2.0 * PLUTO_GM / PLUTO_RADIUS)
PLUTO_OBLATENESS = math.sqrt(PLUTO_FLATNESS * (2.0 - PLUTO_FLATNESS))
PLUTO_GRAVITY = PLUTO_GM / (PLUTO_RADIUS * PLUTO_RADIUS)
PLUTO_MASS = PLUTO_GM / Kw.GRAVITATION
PLUTO_VOLUME = 2.0 * Kw.TAU / 3.0 * PLUTO_RADIUS * PLUTO_RADIUS *\
         PLUTO_RADIUS
PLUTO_SURFACE = 2.0 * Kw.TAU * PLUTO_RADIUS * PLUTO_RADIUS
PLUTO_DENSITY = PLUTO_MASS / PLUTO_VOLUME
PLUTO_SYNODIC = EARTH_SIDEREALYEAR * PLUTO_YEAR / (PLUTO_YEAR -\
         EARTH_SIDEREALYEAR)
MOON_B = MOON_A * (1.0 - MOON_FLATNESS)
MOON_RADIUS = (MOON_A + MOON_B + MOON_C) / 3.0
MOON_ESCAPE = math.sqrt(2.0 * MOON_GM / MOON_RADIUS)
MOON_OBLATENESS = math.sqrt(MOON_FLATNESS * (2.0 - MOON_FLATNESS))
MOON_GRAVITY = MOON_GM / (MOON_RADIUS * MOON_RADIUS)
MOON_MASS = MOON_GM / Kw.GRAVITATION
MOON_VOLUME = 2.0 * Kw.TAU / 3.0 * MOON_RADIUS * MOON_RADIUS * MOON_RADIUS
MOON_SURFACE = 2.0 * Kw.TAU * MOON_RADIUS * MOON_RADIUS
MOON_DENSITY = MOON_MASS / MOON_VOLUME
MOON_SYNODIC = EARTH_SIDEREALYEAR * MOON_YEAR / (MOON_YEAR -\
         EARTH_SIDEREALYEAR)
CERES_B = CERES_A * (1.0 - CERES_FLATNESS)
CERES_RADIUS = (CERES_A + CERES_B + CERES_C) / 3.0
CERES_ESCAPE = math.sqrt(2.0 * CERES_GM / CERES_RADIUS)
CERES_OBLATENESS = math.sqrt(CERES_FLATNESS * (2.0 - CERES_FLATNESS))
CERES_GRAVITY = CERES_GM / (CERES_RADIUS * CERES_RADIUS)
CERES_MASS = CERES_GM / Kw.GRAVITATION
CERES_VOLUME = 2.0 * Kw.TAU / 3.0 * CERES_RADIUS * CERES_RADIUS *\
         CERES_RADIUS
CERES_SURFACE = 2.0 * Kw.TAU * CERES_RADIUS * CERES_RADIUS
CERES_DENSITY = CERES_MASS / CERES_VOLUME
CERES_SYNODIC = EARTH_SIDEREALYEAR * CERES_YEAR / (CERES_YEAR -\
         EARTH_SIDEREALYEAR)
ERIS_B = ERIS_A * (1.0 - ERIS_FLATNESS)
ERIS_RADIUS = (ERIS_A + ERIS_B + ERIS_C) / 3.0
ERIS_ESCAPE = math.sqrt(2.0 * ERIS_GM / ERIS_RADIUS)
ERIS_OBLATENESS = math.sqrt(ERIS_FLATNESS * (2.0 - ERIS_FLATNESS))
ERIS_GRAVITY = ERIS_GM / (ERIS_RADIUS * ERIS_RADIUS)
ERIS_MASS = ERIS_GM / Kw.GRAVITATION
ERIS_VOLUME = 2.0 * Kw.TAU / 3.0 * ERIS_RADIUS * ERIS_RADIUS * ERIS_RADIUS
ERIS_SURFACE = 2.0 * Kw.TAU * ERIS_RADIUS * ERIS_RADIUS
ERIS_DENSITY = ERIS_MASS / ERIS_VOLUME
ERIS_SYNODIC = EARTH_SIDEREALYEAR * ERIS_YEAR / (ERIS_YEAR -\
         EARTH_SIDEREALYEAR)
MAKEMAKE_B = MAKEMAKE_A * (1.0 - MAKEMAKE_FLATNESS)
MAKEMAKE_RADIUS = (MAKEMAKE_A + MAKEMAKE_B + MAKEMAKE_C) / 3.0
MAKEMAKE_ESCAPE = math.sqrt(2.0 * MAKEMAKE_GM / MAKEMAKE_RADIUS)
MAKEMAKE_OBLATENESS = math.sqrt(MAKEMAKE_FLATNESS * (2.0 -\
         MAKEMAKE_FLATNESS))
MAKEMAKE_GRAVITY = MAKEMAKE_GM / (MAKEMAKE_RADIUS * MAKEMAKE_RADIUS)
MAKEMAKE_MASS = MAKEMAKE_GM / Kw.GRAVITATION
MAKEMAKE_VOLUME = 2.0 * Kw.TAU / 3.0 * MAKEMAKE_RADIUS * MAKEMAKE_RADIUS\
         * MAKEMAKE_RADIUS
MAKEMAKE_SURFACE = 2.0 * Kw.TAU * MAKEMAKE_RADIUS * MAKEMAKE_RADIUS
MAKEMAKE_DENSITY = MAKEMAKE_MASS / MAKEMAKE_VOLUME
MAKEMAKE_SYNODIC = EARTH_SIDEREALYEAR * MAKEMAKE_YEAR / (MAKEMAKE_YEAR -\
         EARTH_SIDEREALYEAR)
HAUMEA_B = HAUMEA_A * (1.0 - HAUMEA_FLATNESS)
HAUMEA_RADIUS = (HAUMEA_A + HAUMEA_B + HAUMEA_C) / 3.0
HAUMEA_ESCAPE = math.sqrt(2.0 * HAUMEA_GM / HAUMEA_RADIUS)
HAUMEA_OBLATENESS = math.sqrt(HAUMEA_FLATNESS * (2.0 - HAUMEA_FLATNESS))
HAUMEA_GRAVITY = HAUMEA_GM / (HAUMEA_RADIUS * HAUMEA_RADIUS)
HAUMEA_MASS = HAUMEA_GM / Kw.GRAVITATION
HAUMEA_VOLUME = 2.0 * Kw.TAU / 3.0 * HAUMEA_RADIUS * HAUMEA_RADIUS *\
         HAUMEA_RADIUS
HAUMEA_SURFACE = 2.0 * Kw.TAU * HAUMEA_RADIUS * HAUMEA_RADIUS
HAUMEA_DENSITY = HAUMEA_MASS / HAUMEA_VOLUME
HAUMEA_SYNODIC = EARTH_SIDEREALYEAR * HAUMEA_YEAR / (HAUMEA_YEAR -\
         EARTH_SIDEREALYEAR)
SUN_GMIERS = 1.32712442099E+20 * Kw.UNITGM
SUN_GMNASA = SUN_GM
EARTH_THETA_0 = 0.7790572732640 * Kw.TURN
MOON_ORBIT = 3.843999E+8 * Kw.METER
MOON_ECCENTRICITY = 0.0549
MOON_INCLINATION = 5.415 * Kw.ARCDEG
SUN_ORBIT = 0.0 * Kw.AU
SUN_ECCENTRICITY = 0.0
SUN_INCLINATION = 0.0 * Kw.ARCDEG
SUN_LONGITUDE = 0.0 * Kw.ARCDEG
SUN_PERIAPSIS = 0.0 * Kw.ARCDEG
SUN_ASCENDING = 0.0 * Kw.ARCDEG
SUN_ORBIT_DT = 0.0 * Kw.AU / Kw.JCENTURY
SUN_ECCENTRICITY_DT = 0.0 / Kw.JCENTURY
SUN_INCLINATION_DT = 0.0 * Kw.ARCDEG / Kw.JCENTURY
SUN_LONGITUDE_DT = 0.0 * Kw.ARCDEG / Kw.JCENTURY
SUN_PERIAPSIS_DT = 0.0 * Kw.ARCDEG / Kw.JCENTURY
SUN_ASCENDING_DT = 0.0 * Kw.ARCDEG / Kw.JCENTURY
EARTH_ORBIT = 1.00000261 * Kw.AU
EARTH_ECCENTRICITY = 0.01671123
EARTH_INCLINATION = 359.99998469 * Kw.ARCDEG
EARTH_LONGITUDE = 100.46457166 * Kw.ARCDEG
EARTH_PERIAPSIS = 102.93768193 * Kw.ARCDEG
EARTH_ASCENDING = 0.0 * Kw.ARCDEG
EARTH_ORBIT_DT = 0.00000562 * Kw.AU / Kw.JCENTURY
EARTH_ECCENTRICITY_DT = -0.00004392 / Kw.JCENTURY
EARTH_INCLINATION_DT = -0.01294668 * Kw.ARCDEG / Kw.JCENTURY
EARTH_LONGITUDE_DT = 35999.37244981 * Kw.ARCDEG / Kw.JCENTURY
EARTH_PERIAPSIS_DT = 0.32327364 * Kw.ARCDEG / Kw.JCENTURY
EARTH_ASCENDING_DT = 0.0 * Kw.ARCDEG / Kw.JCENTURY
MERCURY_ORBIT = 0.38709927 * Kw.AU
MERCURY_ECCENTRICITY = 0.20563593
MERCURY_INCLINATION = 7.00497902 * Kw.ARCDEG
MERCURY_LONGITUDE = 252.25032350 * Kw.ARCDEG
MERCURY_PERIAPSIS = 77.45779628 * Kw.ARCDEG
MERCURY_ASCENDING = 48.33076593 * Kw.ARCDEG
MERCURY_ORBIT_DT = 0.00000037 * Kw.AU / Kw.JCENTURY
MERCURY_ECCENTRICITY_DT = 0.00001906 / Kw.JCENTURY
MERCURY_INCLINATION_DT = -0.00594749 * Kw.ARCDEG / Kw.JCENTURY
MERCURY_LONGITUDE_DT = 149472.67411175 * Kw.ARCDEG / Kw.JCENTURY
MERCURY_PERIAPSIS_DT = 0.16047689 * Kw.ARCDEG / Kw.JCENTURY
MERCURY_ASCENDING_DT = -0.12534081 * Kw.ARCDEG / Kw.JCENTURY
VENUS_ORBIT = 0.72333566 * Kw.AU
VENUS_ECCENTRICITY = 0.00677672
VENUS_INCLINATION = 3.39467605 * Kw.ARCDEG
VENUS_LONGITUDE = 181.97909950 * Kw.ARCDEG
VENUS_PERIAPSIS = 131.60246718 * Kw.ARCDEG
VENUS_ASCENDING = 76.67984255 * Kw.ARCDEG
VENUS_ORBIT_DT = 0.00000390 * Kw.AU / Kw.JCENTURY
VENUS_ECCENTRICITY_DT = -0.00004107 / Kw.JCENTURY
VENUS_INCLINATION_DT = -0.00078890 * Kw.ARCDEG / Kw.JCENTURY
VENUS_LONGITUDE_DT = 58517.81538729 * Kw.ARCDEG / Kw.JCENTURY
VENUS_PERIAPSIS_DT = 0.00268329 * Kw.ARCDEG / Kw.JCENTURY
VENUS_ASCENDING_DT = -0.27769418 * Kw.ARCDEG / Kw.JCENTURY
MARS_ORBIT = 1.52371034 * Kw.AU
MARS_ECCENTRICITY = 0.09339410
MARS_INCLINATION = 1.84969142 * Kw.ARCDEG
MARS_LONGITUDE = 355.44656795 * Kw.ARCDEG
MARS_PERIAPSIS = 336.05637041 * Kw.ARCDEG
MARS_ASCENDING = 49.55953891 * Kw.ARCDEG
MARS_ORBIT_DT = 0.00001847 * Kw.AU / Kw.JCENTURY
MARS_ECCENTRICITY_DT = 0.00007882 / Kw.JCENTURY
MARS_INCLINATION_DT = -0.00813131 * Kw.ARCDEG / Kw.JCENTURY
MARS_LONGITUDE_DT = 19140.30268499 * Kw.ARCDEG / Kw.JCENTURY
MARS_PERIAPSIS_DT = 0.44441088 * Kw.ARCDEG / Kw.JCENTURY
MARS_ASCENDING_DT = -0.29257343 * Kw.ARCDEG / Kw.JCENTURY
JUPITER_ORBIT = 5.20288700 * Kw.AU
JUPITER_ECCENTRICITY = 0.04838624
JUPITER_INCLINATION = 1.30439695 * Kw.ARCDEG
JUPITER_LONGITUDE = 34.39644051 * Kw.ARCDEG
JUPITER_PERIAPSIS = 14.72847983 * Kw.ARCDEG
JUPITER_ASCENDING = 100.47390909 * Kw.ARCDEG
JUPITER_ORBIT_DT = -0.00011607 * Kw.AU / Kw.JCENTURY
JUPITER_ECCENTRICITY_DT = -0.00013253 / Kw.JCENTURY
JUPITER_INCLINATION_DT = -0.00183714 * Kw.ARCDEG / Kw.JCENTURY
JUPITER_LONGITUDE_DT = 3034.74612775 * Kw.ARCDEG / Kw.JCENTURY
JUPITER_PERIAPSIS_DT = 0.21252668 * Kw.ARCDEG / Kw.JCENTURY
JUPITER_ASCENDING_DT = 0.20469106 * Kw.ARCDEG / Kw.JCENTURY
SATURN_ORBIT = 9.53667594 * Kw.AU
SATURN_ECCENTRICITY = 0.05386179
SATURN_INCLINATION = 2.48599187 * Kw.ARCDEG
SATURN_LONGITUDE = 49.95424423 * Kw.ARCDEG
SATURN_PERIAPSIS = 92.59887831 * Kw.ARCDEG
SATURN_ASCENDING = 113.66242448 * Kw.ARCDEG
SATURN_ORBIT_DT = -0.00125060 * Kw.AU / Kw.JCENTURY
SATURN_ECCENTRICITY_DT = -0.00050991 / Kw.JCENTURY
SATURN_INCLINATION_DT = 0.00193609 * Kw.ARCDEG / Kw.JCENTURY
SATURN_LONGITUDE_DT = 1222.49362201 * Kw.ARCDEG / Kw.JCENTURY
SATURN_PERIAPSIS_DT = -0.41897216 * Kw.ARCDEG / Kw.JCENTURY
SATURN_ASCENDING_DT = -0.28867794 * Kw.ARCDEG / Kw.JCENTURY
URANUS_ORBIT = 19.18916464 * Kw.AU
URANUS_ECCENTRICITY = 0.04725744
URANUS_INCLINATION = 0.77263783 * Kw.ARCDEG
URANUS_LONGITUDE = 313.23810451 * Kw.ARCDEG
URANUS_PERIAPSIS = 170.95427630 * Kw.ARCDEG
URANUS_ASCENDING = 74.01692503 * Kw.ARCDEG
URANUS_ORBIT_DT = -0.00196176 * Kw.AU / Kw.JCENTURY
URANUS_ECCENTRICITY_DT = -0.00004397 / Kw.JCENTURY
URANUS_INCLINATION_DT = -0.00242939 * Kw.ARCDEG / Kw.JCENTURY
URANUS_LONGITUDE_DT = 428.48202785 * Kw.ARCDEG / Kw.JCENTURY
URANUS_PERIAPSIS_DT = 0.40805281 * Kw.ARCDEG / Kw.JCENTURY
URANUS_ASCENDING_DT = 0.04240589 * Kw.ARCDEG / Kw.JCENTURY
NEPTUNE_ORBIT = 30.06992276 * Kw.AU
NEPTUNE_ECCENTRICITY = 0.00859048
NEPTUNE_INCLINATION = 1.77004347 * Kw.ARCDEG
NEPTUNE_LONGITUDE = 304.87997031 * Kw.ARCDEG
NEPTUNE_PERIAPSIS = 44.96476227 * Kw.ARCDEG
NEPTUNE_ASCENDING = 131.78422574 * Kw.ARCDEG
NEPTUNE_ORBIT_DT = 0.00026291 * Kw.AU / Kw.JCENTURY
NEPTUNE_ECCENTRICITY_DT = 0.00005105 / Kw.JCENTURY
NEPTUNE_INCLINATION_DT = 0.00035372 * Kw.ARCDEG / Kw.JCENTURY
NEPTUNE_LONGITUDE_DT = 218.45945325 * Kw.ARCDEG / Kw.JCENTURY
NEPTUNE_PERIAPSIS_DT = -0.32241464 * Kw.ARCDEG / Kw.JCENTURY
NEPTUNE_ASCENDING_DT = -0.00508664 * Kw.ARCDEG / Kw.JCENTURY
PLUTO_ORBIT = 39.48211675 * Kw.AU
PLUTO_ECCENTRICITY = 0.24882730
PLUTO_INCLINATION = 17.14001206 * Kw.ARCDEG
PLUTO_LONGITUDE = 238.92903833 * Kw.ARCDEG
PLUTO_PERIAPSIS = 224.06891629 * Kw.ARCDEG
PLUTO_ASCENDING = 110.30393684 * Kw.ARCDEG
PLUTO_ORBIT_DT = -0.00031596 * Kw.AU / Kw.JCENTURY
PLUTO_ECCENTRICITY_DT = 0.00005170 / Kw.JCENTURY
PLUTO_INCLINATION_DT = 0.00004818 * Kw.ARCDEG / Kw.JCENTURY
PLUTO_LONGITUDE_DT = 145.20780515 * Kw.ARCDEG / Kw.JCENTURY
PLUTO_PERIAPSIS_DT = -0.04062942 * Kw.ARCDEG / Kw.JCENTURY
PLUTO_ASCENDING_DT = -0.01183482 * Kw.ARCDEG / Kw.JCENTURY
CERES_ORBIT = 2.76740933 * Kw.AU
CERES_ECCENTRICITY = 0.07560729
CERES_INCLINATION = 10.59321706 * Kw.ARCDEG
CERES_LONGITUDE = 102.82668 * Kw.ARCDEG
CERES_PERIAPSIS = 73.023742647 * Kw.ARCDEG
CERES_ASCENDING = 80.308882612359 * Kw.ARCDEG
CERES_ORBIT_DT = 0.0 * Kw.AU / Kw.JCENTURY
CERES_ECCENTRICITY_DT = 0.0 / Kw.JCENTURY
CERES_INCLINATION_DT = 0.0 * Kw.ARCDEG / Kw.JCENTURY
CERES_LONGITUDE_DT = 0.0 * Kw.ARCDEG / Kw.JCENTURY
CERES_PERIAPSIS_DT = 0.0 * Kw.ARCDEG / Kw.JCENTURY
CERES_ASCENDING_DT = 0.0 * Kw.ARCDEG / Kw.JCENTURY
ERIS_ORBIT = 67.781 * Kw.AU
ERIS_ECCENTRICITY = 0.44068
ERIS_INCLINATION = 44.0445 * Kw.ARCDEG
ERIS_LONGITUDE = 32.4926663 * Kw.ARCDEG
ERIS_PERIAPSIS = 151.60371236817 * Kw.ARCDEG
ERIS_ASCENDING = 35.87992471211 * Kw.ARCDEG
ERIS_ORBIT_DT = 0.0 * Kw.AU / Kw.JCENTURY
ERIS_ECCENTRICITY_DT = 0.0 / Kw.JCENTURY
ERIS_INCLINATION_DT = 0.0 * Kw.ARCDEG / Kw.JCENTURY
ERIS_LONGITUDE_DT = 0.0 * Kw.ARCDEG / Kw.JCENTURY
ERIS_PERIAPSIS_DT = 0.0 * Kw.ARCDEG / Kw.JCENTURY
ERIS_ASCENDING_DT = 0.0 * Kw.ARCDEG / Kw.JCENTURY
MAKEMAKE_ORBIT = 45.715 * Kw.AU
MAKEMAKE_ECCENTRICITY = 0.15586
MAKEMAKE_INCLINATION = 29.00685 * Kw.ARCDEG
MAKEMAKE_LONGITUDE = 177.2966805 * Kw.ARCDEG
MAKEMAKE_PERIAPSIS = 295.642772002 * Kw.ARCDEG
MAKEMAKE_ASCENDING = 79.616805978978 * Kw.ARCDEG
MAKEMAKE_ORBIT_DT = 0.0 * Kw.AU / Kw.JCENTURY
MAKEMAKE_ECCENTRICITY_DT = 0.0 / Kw.JCENTURY
MAKEMAKE_INCLINATION_DT = 0.0 * Kw.ARCDEG / Kw.JCENTURY
MAKEMAKE_LONGITUDE_DT = 0.0 * Kw.ARCDEG / Kw.JCENTURY
MAKEMAKE_PERIAPSIS_DT = 0.0 * Kw.ARCDEG / Kw.JCENTURY
MAKEMAKE_ASCENDING_DT = 0.0 * Kw.ARCDEG / Kw.JCENTURY
HAUMEA_ORBIT = 43.218 * Kw.AU
HAUMEA_ECCENTRICITY = 0.19126
HAUMEA_INCLINATION = 28.19 * Kw.ARCDEG
HAUMEA_LONGITUDE = 215.687315 * Kw.ARCDEG
HAUMEA_PERIAPSIS = 238.69440821915 * Kw.ARCDEG
HAUMEA_ASCENDING = 122.01840302632 * Kw.ARCDEG
HAUMEA_ORBIT_DT = 0.0 * Kw.AU / Kw.JCENTURY
HAUMEA_ECCENTRICITY_DT = 0.0 / Kw.JCENTURY
HAUMEA_INCLINATION_DT = 0.0 * Kw.ARCDEG / Kw.JCENTURY
HAUMEA_LONGITUDE_DT = 0.0 * Kw.ARCDEG / Kw.JCENTURY
HAUMEA_PERIAPSIS_DT = 0.0 * Kw.ARCDEG / Kw.JCENTURY
HAUMEA_ASCENDING_DT = 0.0 * Kw.ARCDEG / Kw.JCENTURY
def orbitgm_v(gm_gm, orbit_m):
   return (math.sqrt(gm_gm / orbit_m))
def orbit_v(mass_kg, orbit_m):
   return (orbitgm_v(Kw.GRAVITATION * mass_kg, orbit_m))
def margot(pmass, porbit):
   if (pmass <= 0.0 or porbit <= 0.0):
      retvalu = 0.0
   else:
      retvalu = 5.0401742E-10 * pmass / math.exp(math.log(porbit) * 1.125)
   return (retvalu)
def sternlevison(pmass, porbit):
   if (pmass <= 0.0 or porbit <= 0.0):
      retvalu = 0.0
   else:
      xx = 2.0 * math.log(pmass) - 1.5 * math.log(porbit)
      retvalu = 2.482E-28 * math.exp(xx)
   return (retvalu)
LC_P1_ERR = -1
LC_P1_PREV_PL = -1
LC_P1_SUN = 0
LC_P1_MERCURY = 1
LC_P1_VENUS = 2
LC_P1_EARTH = 3
LC_P1_MARS = 4
LC_P1_JUPITER = 5
LC_P1_SATURN = 6
LC_P1_URANUS = 7
LC_P1_NEPTUNE = 8
LC_P1_PLUTO = 9
LC_P1_CERES = 10
LC_P1_ERIS = 11
LC_P1_MAKEMAKE = 12
LC_P1_HAUMEA = 13
LC_P1_CNT = 14
LC_P2_GM = 0
LC_P2_DAY = 1
LC_P2_FLATNESS = 2
LC_P2_A = 3
LC_P2_C = 4
LC_P2_YEAR = 5
LC_P2_ORB = 6
LC_P2_ECC = 7
LC_P2_INC = 8
LC_P2_LON = 9
LC_P2_PER = 10
LC_P2_ASC = 11
LC_P2_ORB_DT = 12
LC_P2_ECC_DT = 13
LC_P2_INC_DT = 14
LC_P2_LON_DT = 15
LC_P2_PER_DT = 16
LC_P2_ASC_DT = 17
LC_P2_CNT = 18
lv_plsun_arr = [0 for ii in range(3)]
lv_plgeo_arr = [0 for ii in range(3)]
lv_pl_ind = LC_P1_PREV_PL
lv_pl_mtrx = [[0 for ii in range(LC_P2_CNT)] for ii in range(LC_P1_CNT)]
lv_pl_earth_year = EARTH_YEAR
lv_pl_jtwoktime = 1.0 / 64.0
def lf_pl_init(plnt):
   global lv_pl_ind
   global lv_pl_mtrx
   if (lv_pl_ind < 0):
      lv_pl_mtrx[LC_P1_SUN][LC_P2_GM] = SUN_GM
      lv_pl_mtrx[LC_P1_SUN][LC_P2_DAY] = SUN_DAY
      lv_pl_mtrx[LC_P1_SUN][LC_P2_FLATNESS] = SUN_FLATNESS
      lv_pl_mtrx[LC_P1_SUN][LC_P2_A] = SUN_A
      lv_pl_mtrx[LC_P1_SUN][LC_P2_C] = SUN_C
      lv_pl_mtrx[LC_P1_SUN][LC_P2_YEAR] = SUN_YEAR
      lv_pl_mtrx[LC_P1_SUN][LC_P2_ORB] = SUN_ORBIT
      lv_pl_mtrx[LC_P1_SUN][LC_P2_ECC] = SUN_ECCENTRICITY
      lv_pl_mtrx[LC_P1_SUN][LC_P2_INC] = SUN_INCLINATION
      lv_pl_mtrx[LC_P1_SUN][LC_P2_LON] = SUN_LONGITUDE
      lv_pl_mtrx[LC_P1_SUN][LC_P2_PER] = SUN_PERIAPSIS
      lv_pl_mtrx[LC_P1_SUN][LC_P2_ASC] = SUN_ASCENDING
      lv_pl_mtrx[LC_P1_SUN][LC_P2_ORB_DT] = SUN_ORBIT_DT
      lv_pl_mtrx[LC_P1_SUN][LC_P2_ECC_DT] = SUN_ECCENTRICITY_DT
      lv_pl_mtrx[LC_P1_SUN][LC_P2_INC_DT] = SUN_INCLINATION_DT
      lv_pl_mtrx[LC_P1_SUN][LC_P2_LON_DT] = SUN_LONGITUDE_DT
      lv_pl_mtrx[LC_P1_SUN][LC_P2_PER_DT] = SUN_PERIAPSIS_DT
      lv_pl_mtrx[LC_P1_SUN][LC_P2_ASC_DT] = SUN_ASCENDING_DT
      lv_pl_mtrx[LC_P1_MERCURY][LC_P2_GM] = MERCURY_GM
      lv_pl_mtrx[LC_P1_MERCURY][LC_P2_DAY] = MERCURY_DAY
      lv_pl_mtrx[LC_P1_MERCURY][LC_P2_FLATNESS] = MERCURY_FLATNESS
      lv_pl_mtrx[LC_P1_MERCURY][LC_P2_A] = MERCURY_A
      lv_pl_mtrx[LC_P1_MERCURY][LC_P2_C] = MERCURY_C
      lv_pl_mtrx[LC_P1_MERCURY][LC_P2_YEAR] = MERCURY_YEAR
      lv_pl_mtrx[LC_P1_MERCURY][LC_P2_ORB] = MERCURY_ORBIT
      lv_pl_mtrx[LC_P1_MERCURY][LC_P2_ECC] = MERCURY_ECCENTRICITY
      lv_pl_mtrx[LC_P1_MERCURY][LC_P2_INC] = MERCURY_INCLINATION
      lv_pl_mtrx[LC_P1_MERCURY][LC_P2_LON] = MERCURY_LONGITUDE
      lv_pl_mtrx[LC_P1_MERCURY][LC_P2_PER] = MERCURY_PERIAPSIS
      lv_pl_mtrx[LC_P1_MERCURY][LC_P2_ASC] = MERCURY_ASCENDING
      lv_pl_mtrx[LC_P1_MERCURY][LC_P2_ORB_DT] = MERCURY_ORBIT_DT
      lv_pl_mtrx[LC_P1_MERCURY][LC_P2_ECC_DT] = MERCURY_ECCENTRICITY_DT
      lv_pl_mtrx[LC_P1_MERCURY][LC_P2_INC_DT] = MERCURY_INCLINATION_DT
      lv_pl_mtrx[LC_P1_MERCURY][LC_P2_LON_DT] = MERCURY_LONGITUDE_DT
      lv_pl_mtrx[LC_P1_MERCURY][LC_P2_PER_DT] = MERCURY_PERIAPSIS_DT
      lv_pl_mtrx[LC_P1_MERCURY][LC_P2_ASC_DT] = MERCURY_ASCENDING_DT
      lv_pl_mtrx[LC_P1_VENUS][LC_P2_GM] = VENUS_GM
      lv_pl_mtrx[LC_P1_VENUS][LC_P2_DAY] = VENUS_DAY
      lv_pl_mtrx[LC_P1_VENUS][LC_P2_FLATNESS] = VENUS_FLATNESS
      lv_pl_mtrx[LC_P1_VENUS][LC_P2_A] = VENUS_A
      lv_pl_mtrx[LC_P1_VENUS][LC_P2_C] = VENUS_C
      lv_pl_mtrx[LC_P1_VENUS][LC_P2_YEAR] = VENUS_YEAR
      lv_pl_mtrx[LC_P1_VENUS][LC_P2_ORB] = VENUS_ORBIT
      lv_pl_mtrx[LC_P1_VENUS][LC_P2_ECC] = VENUS_ECCENTRICITY
      lv_pl_mtrx[LC_P1_VENUS][LC_P2_INC] = VENUS_INCLINATION
      lv_pl_mtrx[LC_P1_VENUS][LC_P2_LON] = VENUS_LONGITUDE
      lv_pl_mtrx[LC_P1_VENUS][LC_P2_PER] = VENUS_PERIAPSIS
      lv_pl_mtrx[LC_P1_VENUS][LC_P2_ASC] = VENUS_ASCENDING
      lv_pl_mtrx[LC_P1_VENUS][LC_P2_ORB_DT] = VENUS_ORBIT_DT
      lv_pl_mtrx[LC_P1_VENUS][LC_P2_ECC_DT] = VENUS_ECCENTRICITY_DT
      lv_pl_mtrx[LC_P1_VENUS][LC_P2_INC_DT] = VENUS_INCLINATION_DT
      lv_pl_mtrx[LC_P1_VENUS][LC_P2_LON_DT] = VENUS_LONGITUDE_DT
      lv_pl_mtrx[LC_P1_VENUS][LC_P2_PER_DT] = VENUS_PERIAPSIS_DT
      lv_pl_mtrx[LC_P1_VENUS][LC_P2_ASC_DT] = VENUS_ASCENDING_DT
      lv_pl_mtrx[LC_P1_EARTH][LC_P2_GM] = EARTH_GM
      lv_pl_mtrx[LC_P1_EARTH][LC_P2_DAY] = EARTH_DAY
      lv_pl_mtrx[LC_P1_EARTH][LC_P2_FLATNESS] = EARTH_FLATNESS
      lv_pl_mtrx[LC_P1_EARTH][LC_P2_A] = EARTH_A
      lv_pl_mtrx[LC_P1_EARTH][LC_P2_C] = EARTH_C
      lv_pl_mtrx[LC_P1_EARTH][LC_P2_YEAR] = EARTH_YEAR
      lv_pl_mtrx[LC_P1_EARTH][LC_P2_ORB] = EARTH_ORBIT
      lv_pl_mtrx[LC_P1_EARTH][LC_P2_ECC] = EARTH_ECCENTRICITY
      lv_pl_mtrx[LC_P1_EARTH][LC_P2_INC] = EARTH_INCLINATION
      lv_pl_mtrx[LC_P1_EARTH][LC_P2_LON] = EARTH_LONGITUDE
      lv_pl_mtrx[LC_P1_EARTH][LC_P2_PER] = EARTH_PERIAPSIS
      lv_pl_mtrx[LC_P1_EARTH][LC_P2_ASC] = EARTH_ASCENDING
      lv_pl_mtrx[LC_P1_EARTH][LC_P2_ORB_DT] = EARTH_ORBIT_DT
      lv_pl_mtrx[LC_P1_EARTH][LC_P2_ECC_DT] = EARTH_ECCENTRICITY_DT
      lv_pl_mtrx[LC_P1_EARTH][LC_P2_INC_DT] = EARTH_INCLINATION_DT
      lv_pl_mtrx[LC_P1_EARTH][LC_P2_LON_DT] = EARTH_LONGITUDE_DT
      lv_pl_mtrx[LC_P1_EARTH][LC_P2_PER_DT] = EARTH_PERIAPSIS_DT
      lv_pl_mtrx[LC_P1_EARTH][LC_P2_ASC_DT] = EARTH_ASCENDING_DT
      lv_pl_mtrx[LC_P1_MARS][LC_P2_GM] = MARS_GM
      lv_pl_mtrx[LC_P1_MARS][LC_P2_DAY] = MARS_DAY
      lv_pl_mtrx[LC_P1_MARS][LC_P2_FLATNESS] = MARS_FLATNESS
      lv_pl_mtrx[LC_P1_MARS][LC_P2_A] = MARS_A
      lv_pl_mtrx[LC_P1_MARS][LC_P2_C] = MARS_C
      lv_pl_mtrx[LC_P1_MARS][LC_P2_YEAR] = MARS_YEAR
      lv_pl_mtrx[LC_P1_MARS][LC_P2_ORB] = MARS_ORBIT
      lv_pl_mtrx[LC_P1_MARS][LC_P2_ECC] = MARS_ECCENTRICITY
      lv_pl_mtrx[LC_P1_MARS][LC_P2_INC] = MARS_INCLINATION
      lv_pl_mtrx[LC_P1_MARS][LC_P2_LON] = MARS_LONGITUDE
      lv_pl_mtrx[LC_P1_MARS][LC_P2_PER] = MARS_PERIAPSIS
      lv_pl_mtrx[LC_P1_MARS][LC_P2_ASC] = MARS_ASCENDING
      lv_pl_mtrx[LC_P1_MARS][LC_P2_ORB_DT] = MARS_ORBIT_DT
      lv_pl_mtrx[LC_P1_MARS][LC_P2_ECC_DT] = MARS_ECCENTRICITY_DT
      lv_pl_mtrx[LC_P1_MARS][LC_P2_INC_DT] = MARS_INCLINATION_DT
      lv_pl_mtrx[LC_P1_MARS][LC_P2_LON_DT] = MARS_LONGITUDE_DT
      lv_pl_mtrx[LC_P1_MARS][LC_P2_PER_DT] = MARS_PERIAPSIS_DT
      lv_pl_mtrx[LC_P1_MARS][LC_P2_ASC_DT] = MARS_ASCENDING_DT
      lv_pl_mtrx[LC_P1_JUPITER][LC_P2_GM] = JUPITER_GM
      lv_pl_mtrx[LC_P1_JUPITER][LC_P2_DAY] = JUPITER_DAY
      lv_pl_mtrx[LC_P1_JUPITER][LC_P2_FLATNESS] = JUPITER_FLATNESS
      lv_pl_mtrx[LC_P1_JUPITER][LC_P2_A] = JUPITER_A
      lv_pl_mtrx[LC_P1_JUPITER][LC_P2_C] = JUPITER_C
      lv_pl_mtrx[LC_P1_JUPITER][LC_P2_YEAR] = JUPITER_YEAR
      lv_pl_mtrx[LC_P1_JUPITER][LC_P2_ORB] = JUPITER_ORBIT
      lv_pl_mtrx[LC_P1_JUPITER][LC_P2_ECC] = JUPITER_ECCENTRICITY
      lv_pl_mtrx[LC_P1_JUPITER][LC_P2_INC] = JUPITER_INCLINATION
      lv_pl_mtrx[LC_P1_JUPITER][LC_P2_LON] = JUPITER_LONGITUDE
      lv_pl_mtrx[LC_P1_JUPITER][LC_P2_PER] = JUPITER_PERIAPSIS
      lv_pl_mtrx[LC_P1_JUPITER][LC_P2_ASC] = JUPITER_ASCENDING
      lv_pl_mtrx[LC_P1_JUPITER][LC_P2_ORB_DT] = JUPITER_ORBIT_DT
      lv_pl_mtrx[LC_P1_JUPITER][LC_P2_ECC_DT] = JUPITER_ECCENTRICITY_DT
      lv_pl_mtrx[LC_P1_JUPITER][LC_P2_INC_DT] = JUPITER_INCLINATION_DT
      lv_pl_mtrx[LC_P1_JUPITER][LC_P2_LON_DT] = JUPITER_LONGITUDE_DT
      lv_pl_mtrx[LC_P1_JUPITER][LC_P2_PER_DT] = JUPITER_PERIAPSIS_DT
      lv_pl_mtrx[LC_P1_JUPITER][LC_P2_ASC_DT] = JUPITER_ASCENDING_DT
      lv_pl_mtrx[LC_P1_SATURN][LC_P2_GM] = SATURN_GM
      lv_pl_mtrx[LC_P1_SATURN][LC_P2_DAY] = SATURN_DAY
      lv_pl_mtrx[LC_P1_SATURN][LC_P2_FLATNESS] = SATURN_FLATNESS
      lv_pl_mtrx[LC_P1_SATURN][LC_P2_A] = SATURN_A
      lv_pl_mtrx[LC_P1_SATURN][LC_P2_C] = SATURN_C
      lv_pl_mtrx[LC_P1_SATURN][LC_P2_YEAR] = SATURN_YEAR
      lv_pl_mtrx[LC_P1_SATURN][LC_P2_ORB] = SATURN_ORBIT
      lv_pl_mtrx[LC_P1_SATURN][LC_P2_ECC] = SATURN_ECCENTRICITY
      lv_pl_mtrx[LC_P1_SATURN][LC_P2_INC] = SATURN_INCLINATION
      lv_pl_mtrx[LC_P1_SATURN][LC_P2_LON] = SATURN_LONGITUDE
      lv_pl_mtrx[LC_P1_SATURN][LC_P2_PER] = SATURN_PERIAPSIS
      lv_pl_mtrx[LC_P1_SATURN][LC_P2_ASC] = SATURN_ASCENDING
      lv_pl_mtrx[LC_P1_SATURN][LC_P2_ORB_DT] = SATURN_ORBIT_DT
      lv_pl_mtrx[LC_P1_SATURN][LC_P2_ECC_DT] = SATURN_ECCENTRICITY_DT
      lv_pl_mtrx[LC_P1_SATURN][LC_P2_INC_DT] = SATURN_INCLINATION_DT
      lv_pl_mtrx[LC_P1_SATURN][LC_P2_LON_DT] = SATURN_LONGITUDE_DT
      lv_pl_mtrx[LC_P1_SATURN][LC_P2_PER_DT] = SATURN_PERIAPSIS_DT
      lv_pl_mtrx[LC_P1_SATURN][LC_P2_ASC_DT] = SATURN_ASCENDING_DT
      lv_pl_mtrx[LC_P1_URANUS][LC_P2_GM] = URANUS_GM
      lv_pl_mtrx[LC_P1_URANUS][LC_P2_DAY] = URANUS_DAY
      lv_pl_mtrx[LC_P1_URANUS][LC_P2_FLATNESS] = URANUS_FLATNESS
      lv_pl_mtrx[LC_P1_URANUS][LC_P2_A] = URANUS_A
      lv_pl_mtrx[LC_P1_URANUS][LC_P2_C] = URANUS_C
      lv_pl_mtrx[LC_P1_URANUS][LC_P2_YEAR] = URANUS_YEAR
      lv_pl_mtrx[LC_P1_URANUS][LC_P2_ORB] = URANUS_ORBIT
      lv_pl_mtrx[LC_P1_URANUS][LC_P2_ECC] = URANUS_ECCENTRICITY
      lv_pl_mtrx[LC_P1_URANUS][LC_P2_INC] = URANUS_INCLINATION
      lv_pl_mtrx[LC_P1_URANUS][LC_P2_LON] = URANUS_LONGITUDE
      lv_pl_mtrx[LC_P1_URANUS][LC_P2_PER] = URANUS_PERIAPSIS
      lv_pl_mtrx[LC_P1_URANUS][LC_P2_ASC] = URANUS_ASCENDING
      lv_pl_mtrx[LC_P1_URANUS][LC_P2_ORB_DT] = URANUS_ORBIT_DT
      lv_pl_mtrx[LC_P1_URANUS][LC_P2_ECC_DT] = URANUS_ECCENTRICITY_DT
      lv_pl_mtrx[LC_P1_URANUS][LC_P2_INC_DT] = URANUS_INCLINATION_DT
      lv_pl_mtrx[LC_P1_URANUS][LC_P2_LON_DT] = URANUS_LONGITUDE_DT
      lv_pl_mtrx[LC_P1_URANUS][LC_P2_PER_DT] = URANUS_PERIAPSIS_DT
      lv_pl_mtrx[LC_P1_URANUS][LC_P2_ASC_DT] = URANUS_ASCENDING_DT
      lv_pl_mtrx[LC_P1_NEPTUNE][LC_P2_GM] = NEPTUNE_GM
      lv_pl_mtrx[LC_P1_NEPTUNE][LC_P2_DAY] = NEPTUNE_DAY
      lv_pl_mtrx[LC_P1_NEPTUNE][LC_P2_FLATNESS] = NEPTUNE_FLATNESS
      lv_pl_mtrx[LC_P1_NEPTUNE][LC_P2_A] = NEPTUNE_A
      lv_pl_mtrx[LC_P1_NEPTUNE][LC_P2_C] = NEPTUNE_C
      lv_pl_mtrx[LC_P1_NEPTUNE][LC_P2_YEAR] = NEPTUNE_YEAR
      lv_pl_mtrx[LC_P1_NEPTUNE][LC_P2_ORB] = NEPTUNE_ORBIT
      lv_pl_mtrx[LC_P1_NEPTUNE][LC_P2_ECC] = NEPTUNE_ECCENTRICITY
      lv_pl_mtrx[LC_P1_NEPTUNE][LC_P2_INC] = NEPTUNE_INCLINATION
      lv_pl_mtrx[LC_P1_NEPTUNE][LC_P2_LON] = NEPTUNE_LONGITUDE
      lv_pl_mtrx[LC_P1_NEPTUNE][LC_P2_PER] = NEPTUNE_PERIAPSIS
      lv_pl_mtrx[LC_P1_NEPTUNE][LC_P2_ASC] = NEPTUNE_ASCENDING
      lv_pl_mtrx[LC_P1_NEPTUNE][LC_P2_ORB_DT] = NEPTUNE_ORBIT_DT
      lv_pl_mtrx[LC_P1_NEPTUNE][LC_P2_ECC_DT] = NEPTUNE_ECCENTRICITY_DT
      lv_pl_mtrx[LC_P1_NEPTUNE][LC_P2_INC_DT] = NEPTUNE_INCLINATION_DT
      lv_pl_mtrx[LC_P1_NEPTUNE][LC_P2_LON_DT] = NEPTUNE_LONGITUDE_DT
      lv_pl_mtrx[LC_P1_NEPTUNE][LC_P2_PER_DT] = NEPTUNE_PERIAPSIS_DT
      lv_pl_mtrx[LC_P1_NEPTUNE][LC_P2_ASC_DT] = NEPTUNE_ASCENDING_DT
      lv_pl_mtrx[LC_P1_PLUTO][LC_P2_GM] = PLUTO_GM
      lv_pl_mtrx[LC_P1_PLUTO][LC_P2_DAY] = PLUTO_DAY
      lv_pl_mtrx[LC_P1_PLUTO][LC_P2_FLATNESS] = PLUTO_FLATNESS
      lv_pl_mtrx[LC_P1_PLUTO][LC_P2_A] = PLUTO_A
      lv_pl_mtrx[LC_P1_PLUTO][LC_P2_C] = PLUTO_C
      lv_pl_mtrx[LC_P1_PLUTO][LC_P2_YEAR] = PLUTO_YEAR
      lv_pl_mtrx[LC_P1_PLUTO][LC_P2_ORB] = PLUTO_ORBIT
      lv_pl_mtrx[LC_P1_PLUTO][LC_P2_ECC] = PLUTO_ECCENTRICITY
      lv_pl_mtrx[LC_P1_PLUTO][LC_P2_INC] = PLUTO_INCLINATION
      lv_pl_mtrx[LC_P1_PLUTO][LC_P2_LON] = PLUTO_LONGITUDE
      lv_pl_mtrx[LC_P1_PLUTO][LC_P2_PER] = PLUTO_PERIAPSIS
      lv_pl_mtrx[LC_P1_PLUTO][LC_P2_ASC] = PLUTO_ASCENDING
      lv_pl_mtrx[LC_P1_PLUTO][LC_P2_ORB_DT] = PLUTO_ORBIT_DT
      lv_pl_mtrx[LC_P1_PLUTO][LC_P2_ECC_DT] = PLUTO_ECCENTRICITY_DT
      lv_pl_mtrx[LC_P1_PLUTO][LC_P2_INC_DT] = PLUTO_INCLINATION_DT
      lv_pl_mtrx[LC_P1_PLUTO][LC_P2_LON_DT] = PLUTO_LONGITUDE_DT
      lv_pl_mtrx[LC_P1_PLUTO][LC_P2_PER_DT] = PLUTO_PERIAPSIS_DT
      lv_pl_mtrx[LC_P1_PLUTO][LC_P2_ASC_DT] = PLUTO_ASCENDING_DT
      lv_pl_mtrx[LC_P1_CERES][LC_P2_GM] = CERES_GM
      lv_pl_mtrx[LC_P1_CERES][LC_P2_DAY] = CERES_DAY
      lv_pl_mtrx[LC_P1_CERES][LC_P2_FLATNESS] = CERES_FLATNESS
      lv_pl_mtrx[LC_P1_CERES][LC_P2_A] = CERES_A
      lv_pl_mtrx[LC_P1_CERES][LC_P2_C] = CERES_C
      lv_pl_mtrx[LC_P1_CERES][LC_P2_YEAR] = CERES_YEAR
      lv_pl_mtrx[LC_P1_CERES][LC_P2_ORB] = CERES_ORBIT
      lv_pl_mtrx[LC_P1_CERES][LC_P2_ECC] = CERES_ECCENTRICITY
      lv_pl_mtrx[LC_P1_CERES][LC_P2_INC] = CERES_INCLINATION
      lv_pl_mtrx[LC_P1_CERES][LC_P2_LON] = CERES_LONGITUDE
      lv_pl_mtrx[LC_P1_CERES][LC_P2_PER] = CERES_PERIAPSIS
      lv_pl_mtrx[LC_P1_CERES][LC_P2_ASC] = CERES_ASCENDING
      lv_pl_mtrx[LC_P1_CERES][LC_P2_ORB_DT] = CERES_ORBIT_DT
      lv_pl_mtrx[LC_P1_CERES][LC_P2_ECC_DT] = CERES_ECCENTRICITY_DT
      lv_pl_mtrx[LC_P1_CERES][LC_P2_INC_DT] = CERES_INCLINATION_DT
      lv_pl_mtrx[LC_P1_CERES][LC_P2_LON_DT] = CERES_LONGITUDE_DT
      lv_pl_mtrx[LC_P1_CERES][LC_P2_PER_DT] = CERES_PERIAPSIS_DT
      lv_pl_mtrx[LC_P1_CERES][LC_P2_ASC_DT] = CERES_ASCENDING_DT
      lv_pl_mtrx[LC_P1_ERIS][LC_P2_GM] = ERIS_GM
      lv_pl_mtrx[LC_P1_ERIS][LC_P2_DAY] = ERIS_DAY
      lv_pl_mtrx[LC_P1_ERIS][LC_P2_FLATNESS] = ERIS_FLATNESS
      lv_pl_mtrx[LC_P1_ERIS][LC_P2_A] = ERIS_A
      lv_pl_mtrx[LC_P1_ERIS][LC_P2_C] = ERIS_C
      lv_pl_mtrx[LC_P1_ERIS][LC_P2_YEAR] = ERIS_YEAR
      lv_pl_mtrx[LC_P1_ERIS][LC_P2_ORB] = ERIS_ORBIT
      lv_pl_mtrx[LC_P1_ERIS][LC_P2_ECC] = ERIS_ECCENTRICITY
      lv_pl_mtrx[LC_P1_ERIS][LC_P2_INC] = ERIS_INCLINATION
      lv_pl_mtrx[LC_P1_ERIS][LC_P2_LON] = ERIS_LONGITUDE
      lv_pl_mtrx[LC_P1_ERIS][LC_P2_PER] = ERIS_PERIAPSIS
      lv_pl_mtrx[LC_P1_ERIS][LC_P2_ASC] = ERIS_ASCENDING
      lv_pl_mtrx[LC_P1_ERIS][LC_P2_ORB_DT] = ERIS_ORBIT_DT
      lv_pl_mtrx[LC_P1_ERIS][LC_P2_ECC_DT] = ERIS_ECCENTRICITY_DT
      lv_pl_mtrx[LC_P1_ERIS][LC_P2_INC_DT] = ERIS_INCLINATION_DT
      lv_pl_mtrx[LC_P1_ERIS][LC_P2_LON_DT] = ERIS_LONGITUDE_DT
      lv_pl_mtrx[LC_P1_ERIS][LC_P2_PER_DT] = ERIS_PERIAPSIS_DT
      lv_pl_mtrx[LC_P1_ERIS][LC_P2_ASC_DT] = ERIS_ASCENDING_DT
      lv_pl_mtrx[LC_P1_MAKEMAKE][LC_P2_GM] = MAKEMAKE_GM
      lv_pl_mtrx[LC_P1_MAKEMAKE][LC_P2_DAY] = MAKEMAKE_DAY
      lv_pl_mtrx[LC_P1_MAKEMAKE][LC_P2_FLATNESS] = MAKEMAKE_FLATNESS
      lv_pl_mtrx[LC_P1_MAKEMAKE][LC_P2_A] = MAKEMAKE_A
      lv_pl_mtrx[LC_P1_MAKEMAKE][LC_P2_C] = MAKEMAKE_C
      lv_pl_mtrx[LC_P1_MAKEMAKE][LC_P2_YEAR] = MAKEMAKE_YEAR
      lv_pl_mtrx[LC_P1_MAKEMAKE][LC_P2_ORB] = MAKEMAKE_ORBIT
      lv_pl_mtrx[LC_P1_MAKEMAKE][LC_P2_ECC] = MAKEMAKE_ECCENTRICITY
      lv_pl_mtrx[LC_P1_MAKEMAKE][LC_P2_INC] = MAKEMAKE_INCLINATION
      lv_pl_mtrx[LC_P1_MAKEMAKE][LC_P2_LON] = MAKEMAKE_LONGITUDE
      lv_pl_mtrx[LC_P1_MAKEMAKE][LC_P2_PER] = MAKEMAKE_PERIAPSIS
      lv_pl_mtrx[LC_P1_MAKEMAKE][LC_P2_ASC] = MAKEMAKE_ASCENDING
      lv_pl_mtrx[LC_P1_MAKEMAKE][LC_P2_ORB_DT] = MAKEMAKE_ORBIT_DT
      lv_pl_mtrx[LC_P1_MAKEMAKE][LC_P2_ECC_DT] = MAKEMAKE_ECCENTRICITY_DT
      lv_pl_mtrx[LC_P1_MAKEMAKE][LC_P2_INC_DT] = MAKEMAKE_INCLINATION_DT
      lv_pl_mtrx[LC_P1_MAKEMAKE][LC_P2_LON_DT] = MAKEMAKE_LONGITUDE_DT
      lv_pl_mtrx[LC_P1_MAKEMAKE][LC_P2_PER_DT] = MAKEMAKE_PERIAPSIS_DT
      lv_pl_mtrx[LC_P1_MAKEMAKE][LC_P2_ASC_DT] = MAKEMAKE_ASCENDING_DT
      lv_pl_mtrx[LC_P1_HAUMEA][LC_P2_GM] = HAUMEA_GM
      lv_pl_mtrx[LC_P1_HAUMEA][LC_P2_DAY] = HAUMEA_DAY
      lv_pl_mtrx[LC_P1_HAUMEA][LC_P2_FLATNESS] = HAUMEA_FLATNESS
      lv_pl_mtrx[LC_P1_HAUMEA][LC_P2_A] = HAUMEA_A
      lv_pl_mtrx[LC_P1_HAUMEA][LC_P2_C] = HAUMEA_C
      lv_pl_mtrx[LC_P1_HAUMEA][LC_P2_YEAR] = HAUMEA_YEAR
      lv_pl_mtrx[LC_P1_HAUMEA][LC_P2_ORB] = HAUMEA_ORBIT
      lv_pl_mtrx[LC_P1_HAUMEA][LC_P2_ECC] = HAUMEA_ECCENTRICITY
      lv_pl_mtrx[LC_P1_HAUMEA][LC_P2_INC] = HAUMEA_INCLINATION
      lv_pl_mtrx[LC_P1_HAUMEA][LC_P2_LON] = HAUMEA_LONGITUDE
      lv_pl_mtrx[LC_P1_HAUMEA][LC_P2_PER] = HAUMEA_PERIAPSIS
      lv_pl_mtrx[LC_P1_HAUMEA][LC_P2_ASC] = HAUMEA_ASCENDING
      lv_pl_mtrx[LC_P1_HAUMEA][LC_P2_ORB_DT] = HAUMEA_ORBIT_DT
      lv_pl_mtrx[LC_P1_HAUMEA][LC_P2_ECC_DT] = HAUMEA_ECCENTRICITY_DT
      lv_pl_mtrx[LC_P1_HAUMEA][LC_P2_INC_DT] = HAUMEA_INCLINATION_DT
      lv_pl_mtrx[LC_P1_HAUMEA][LC_P2_LON_DT] = HAUMEA_LONGITUDE_DT
      lv_pl_mtrx[LC_P1_HAUMEA][LC_P2_PER_DT] = HAUMEA_PERIAPSIS_DT
      lv_pl_mtrx[LC_P1_HAUMEA][LC_P2_ASC_DT] = HAUMEA_ASCENDING_DT
      if (0 < lv_pl_jtwoktime and lv_pl_jtwoktime < 1.0 / 32.0):
         plsettime(Kw.uet2j2k(Kw.timee()))
      lv_pl_earth_year = EARTH_YEAR
   if (LC_P1_SUN <= plnt and plnt < LC_P1_CNT):
      lv_pl_ind = plnt
   elif (plnt == LC_P1_PREV_PL):
      if (lv_pl_ind < 0):
         lv_pl_ind = LC_P1_EARTH
   else:
      lv_pl_ind = LC_P1_PREV_PL
   return int(lv_pl_ind)
def lf_val(pa_ind, pb_bb, pb_bbd):
   if (pa_ind < LC_P1_PREV_PL or LC_P1_CNT <= pa_ind):
      retvalu = LC_P1_ERR
   else:
      pl_ind = pl(pa_ind)
      retvalu = (lv_pl_mtrx[pl_ind][pb_bb] + lv_pl_jtwoktime *\
               lv_pl_mtrx[pl_ind][pb_bbd])
   return (retvalu)
def pl(plnt):
   return int((lf_pl_init(plnt)))
def plsettime(jtwokdate):
   lv_pl_jtwoktime = jtwokdate * Kw.JDAY
   return (lv_pl_jtwoktime)
def pl_gm(plnt):
   global lv_pl_mtrx
   global lv_pl_ind
   lf_pl_init(plnt)
   if (LC_P1_SUN <= plnt and plnt < LC_P1_CNT):
      retvalu = lv_pl_mtrx[plnt][LC_P2_GM]
   elif (plnt == LC_P1_PREV_PL):
      retvalu = lv_pl_mtrx[lv_pl_ind][LC_P2_GM]
   else:
      retvalu = LC_P1_ERR
   return (retvalu)
def plgm():
   global lv_pl_ind
   return (pl_gm(LC_P1_PREV_PL))
def pl_year(plnt):
   global lv_pl_mtrx
   global lv_pl_ind
   lf_pl_init(plnt)
   if (LC_P1_SUN <= plnt and plnt < LC_P1_CNT):
      retvalu = lv_pl_mtrx[plnt][LC_P2_YEAR]
   elif (plnt == LC_P1_PREV_PL):
      retvalu = lv_pl_mtrx[lv_pl_ind][LC_P2_YEAR]
   else:
      retvalu = LC_P1_ERR
   return (retvalu)
def plyear():
   global lv_pl_ind
   return (pl_year(LC_P1_PREV_PL))
def pl_day(plnt):
   global lv_pl_mtrx
   global lv_pl_ind
   lf_pl_init(plnt)
   if (LC_P1_SUN <= plnt and plnt < LC_P1_CNT):
      retvalu = lv_pl_mtrx[plnt][LC_P2_DAY]
   elif (plnt == LC_P1_PREV_PL):
      retvalu = lv_pl_mtrx[lv_pl_ind][LC_P2_DAY]
   else:
      retvalu = LC_P1_ERR
   return (retvalu)
def plday():
   global lv_pl_ind
   return (pl_day(LC_P1_PREV_PL))
def pl_flatness(plnt):
   global lv_pl_mtrx
   global lv_pl_ind
   lf_pl_init(plnt)
   if (LC_P1_SUN <= plnt and plnt < LC_P1_CNT):
      retvalu = lv_pl_mtrx[plnt][LC_P2_FLATNESS]
   elif (plnt == LC_P1_PREV_PL):
      retvalu = lv_pl_mtrx[lv_pl_ind][LC_P2_FLATNESS]
   else:
      retvalu = LC_P1_ERR
   return (retvalu)
def plflatness():
   global lv_pl_ind
   return (pl_flatness(LC_P1_PREV_PL))
def pl_a(plnt):
   global lv_pl_mtrx
   global lv_pl_ind
   lf_pl_init(plnt)
   if (LC_P1_SUN <= plnt and plnt < LC_P1_CNT):
      retvalu = lv_pl_mtrx[plnt][LC_P2_A]
   elif (plnt == LC_P1_PREV_PL):
      retvalu = lv_pl_mtrx[lv_pl_ind][LC_P2_A]
   else:
      retvalu = LC_P1_ERR
   return (retvalu)
def pla():
   global lv_pl_ind
   return (pl_a(LC_P1_PREV_PL))
def pl_c(plnt):
   global lv_pl_mtrx
   global lv_pl_ind
   lf_pl_init(plnt)
   if (LC_P1_SUN <= plnt and plnt < LC_P1_CNT):
      retvalu = lv_pl_mtrx[plnt][LC_P2_C]
   elif (plnt == LC_P1_PREV_PL):
      retvalu = lv_pl_mtrx[lv_pl_ind][LC_P2_C]
   else:
      retvalu = LC_P1_ERR
   return (retvalu)
def plc():
   global lv_pl_ind
   return (pl_c(LC_P1_PREV_PL))
def pl_orbit(plnt):
   return (lf_val(plnt, LC_P2_ORB, LC_P2_ORB_DT))
def plorbit():
   global lv_pl_ind
   return (pl_orbit(LC_P1_PREV_PL))
def pl_eccentricity(plnt):
   return (lf_val(plnt, LC_P2_ECC, LC_P2_ECC_DT))
def pleccentricity():
   global lv_pl_ind
   return (pl_eccentricity(LC_P1_PREV_PL))
def pl_inclination(plnt):
   return (lf_val(plnt, LC_P2_INC, LC_P2_INC_DT))
def plinclination():
   global lv_pl_ind
   return (pl_inclination(LC_P1_PREV_PL))
def pl_longitude(plnt):
   return (lf_val(plnt, LC_P2_LON, LC_P2_LON_DT))
def pllongitude():
   global lv_pl_ind
   return (pl_longitude(LC_P1_PREV_PL))
def pl_periapsis(plnt):
   return (lf_val(plnt, LC_P2_PER, LC_P2_PER_DT))
def plperiapsis():
   global lv_pl_ind
   return (pl_periapsis(LC_P1_PREV_PL))
def pl_ascending(plnt):
   return (lf_val(plnt, LC_P2_ASC, LC_P2_ASC_DT))
def plascending():
   global lv_pl_ind
   return (pl_ascending(LC_P1_PREV_PL))
def pl_mass(plnt):
   if (plnt < LC_P1_PREV_PL or LC_P1_CNT <= plnt):
      retvalu = LC_P1_ERR
   else:
      retvalu = pl_gm(plnt) / Kw.GRAVITATION
   return (retvalu)
def plmass():
   global lv_pl_ind
   return (pl_mass(LC_P1_PREV_PL))
def pl_b(plnt):
   if (plnt < LC_P1_PREV_PL or LC_P1_CNT <= plnt):
      retvalu = LC_P1_ERR
   else:
      retvalu = (1.0 - pl_flatness(plnt)) * pl_a(plnt)
   return (retvalu)
def plb():
   global lv_pl_ind
   return (pl_b(LC_P1_PREV_PL))
def pl_radius(plnt):
   if (plnt < LC_P1_PREV_PL or LC_P1_CNT <= plnt):
      retvalu = LC_P1_ERR
   else:
      retvalu = (pl_a(plnt) + pl_b(plnt) + pl_c(plnt)) / 3.0
   return (retvalu)
def plradius():
   global lv_pl_ind
   return (pl_radius(LC_P1_PREV_PL))
def pl_gravity(plnt):
   if (plnt < LC_P1_PREV_PL or LC_P1_CNT <= plnt):
      retvalu = LC_P1_ERR
   else:
      retvalu = pl_gm(plnt) / Kw.square(pl_radius(plnt))
   return (retvalu)
def plgravity():
   global lv_pl_ind
   return (pl_gravity(LC_P1_PREV_PL))
def pl_meananomaly(plnt):
   if (plnt < LC_P1_PREV_PL or LC_P1_CNT <= plnt):
      retvalu = LC_P1_ERR
   else:
      retvalu = Kw.fmodu(pl_longitude(plnt) - pl_periapsis(plnt), Kw.TAU)
   return (retvalu)
def plmeananomaly():
   global lv_pl_ind
   return (pl_meananomaly(LC_P1_PREV_PL))
def pl_escape(plnt):
   if (plnt < LC_P1_PREV_PL or LC_P1_CNT <= plnt):
      retvalu = LC_P1_ERR
   else:
      retvalu = math.sqrt(2.0 * pl_gm(plnt) / pl_radius(plnt))
   return (retvalu)
def plescape():
   global lv_pl_ind
   return (pl_escape(LC_P1_PREV_PL))
def pl_synodic(plnt):
   global lv_pl_earth_year
   if (plnt < LC_P1_PREV_PL or LC_P1_CNT <= plnt):
      retvalu = LC_P1_ERR
   else:
      yra = pl_year(plnt)
      retvalu = Kw.divi(yra * lv_pl_earth_year, math.fabs(yra -\
               lv_pl_earth_year), 0.0)
   return (retvalu)
def plsynodic():
   global lv_pl_ind
   return (pl_synodic(LC_P1_PREV_PL))
def pl_volume(plnt):
   if (plnt < LC_P1_PREV_PL or LC_P1_CNT <= plnt):
      retvalu = LC_P1_ERR
   else:
      retvalu = 2.0 * Kw.TAU * pl_a(plnt) * pl_b(plnt) * pl_c(plnt) / 3.0
   return (retvalu)
def plvolume():
   global lv_pl_ind
   return (pl_volume(LC_P1_PREV_PL))
def pl_surface(plnt):
   if (plnt < LC_P1_PREV_PL or LC_P1_CNT <= plnt):
      retvalu = LC_P1_ERR
   else:
      retvalu = Kw.ellipsoid_surface(pl_a(plnt), pl_b(plnt), pl_c(plnt))
   return (retvalu)
def plsurface():
   global lv_pl_ind
   return (pl_surface(LC_P1_PREV_PL))
def pl_density(plnt):
   if (plnt < LC_P1_PREV_PL or LC_P1_CNT <= plnt):
      retvalu = LC_P1_ERR
   else:
      retvalu = pl_mass(plnt) / pl_volume(plnt)
   return (retvalu)
def pldensity():
   global lv_pl_ind
   return (pl_density(LC_P1_PREV_PL))
def pl_argument(plnt):
   if (plnt < LC_P1_PREV_PL or LC_P1_CNT <= plnt):
      retvalu = LC_P1_ERR
   else:
      retvalu = pl_periapsis(plnt) - pl_ascending(plnt)
   return (retvalu)
def plargument():
   global lv_pl_ind
   return (pl_argument(LC_P1_PREV_PL))
def pl_margot(plnt):
   if (plnt < LC_P1_PREV_PL or LC_P1_CNT <= plnt):
      retvalu = LC_P1_ERR
   else:
      retvalu = margot(pl_mass(plnt), pl_orbit(plnt))
   return (retvalu)
def plmargot():
   global lv_pl_ind
   return (pl_margot(LC_P1_PREV_PL))
def pl_sternlevison(plnt):
   if (plnt < LC_P1_PREV_PL or LC_P1_CNT <= plnt):
      retvalu = LC_P1_ERR
   else:
      retvalu = sternlevison(pl_mass(plnt), pl_orbit(plnt))
   return (retvalu)
def plsternlevison():
   global lv_pl_ind
   return (pl_sternlevison(LC_P1_PREV_PL))
def pl_perihelion(plnt):
   if (plnt < LC_P1_PREV_PL or LC_P1_CNT <= plnt):
      retvalu = LC_P1_ERR
   else:
      retvalu = pl_orbit(plnt) * (1.0 - pl_eccentricity(plnt))
   return (retvalu)
def plperihelion():
   global lv_pl_ind
   return (pl_perihelion(LC_P1_PREV_PL))
def pl_aphelion(plnt):
   if (plnt < LC_P1_PREV_PL or LC_P1_CNT <= plnt):
      retvalu = LC_P1_ERR
   else:
      retvalu = pl_orbit(plnt) * (1.0 + pl_eccentricity(plnt))
   return (retvalu)
def plaphelion():
   global lv_pl_ind
   return (pl_aphelion(LC_P1_PREV_PL))
def eccentric_anomaly(mean_ano_rad, eccen):
   mrad = Kw.fmodu(mean_ano_rad, Kw.tur2rad(1.0))
   xrad = mrad + eccen * math.sin(mrad)
   nrvx_xx = xrad
   for nrvx_ii in range(0, 21, 1):
      nrvx_xp = nrvx_xx
      nrvx_dy = 1.0 - eccen * math.cos(nrvx_xx)
      if (Kw.iszero(nrvx_dy)):
         break
      nrvx_yy = nrvx_xx - eccen * math.sin(nrvx_xx) - mean_ano_rad
      nrvx_xx -= nrvx_yy / nrvx_dy
      if (Kw.iseq(nrvx_xp, nrvx_xx)):
         break
   return (nrvx_xx)
def pl_eccentricanomaly(plnt):
   if (plnt < LC_P1_PREV_PL or LC_P1_CNT <= plnt):
      retvalu = LC_P1_ERR
   else:
      retvalu = eccentric_anomaly(pl_meananomaly(plnt),\
               pl_eccentricity(plnt))
   return (retvalu)
def pleccentricanomaly():
   global lv_pl_ind
   return (pl_eccentricanomaly(LC_P1_PREV_PL))
def pl_heliocentric(plnt, jtwok):
   global lv_plsun_arr
   global lv_plgeo_arr
   if (lf_pl_init(plnt) < 0.0):
      retvalu = LC_P1_ERR
   else:
      plsettime(jtwok)
      orb_m = plorbit()
      eccen = pleccentricity()
      inc_rad = plinclination()
      lon_rad = pllongitude()
      per_rad = plperiapsis()
      asc_rad = plascending()
      arg_rad = per_rad - asc_rad
      mean_anomaly_rad = Kw.fmod(lon_rad - per_rad, Kw.tur2rad(1.0))
      eano_rad = eccentric_anomaly(mean_anomaly_rad, eccen)
      dxx_m = orb_m * (math.cos(eano_rad) - eccen)
      dyy_m = orb_m * Kw.topyh1(eccen) * math.sin(eano_rad)
      cw = math.cos(arg_rad)
      sw = math.sin(arg_rad)
      co = math.cos(asc_rad)
      so = math.sin(asc_rad)
      ci = math.cos(inc_rad)
      si = math.sin(inc_rad)
      swci = sw * ci
      cwci = cw * ci
      lv_plsun_arr[0] = (dxx_m * (cw * co - swci * so) - dyy_m * (sw * co\
               + cwci * so))
      lv_plsun_arr[1] = (dxx_m * (cw * so + swci * co) - dyy_m * (sw * so\
               - cwci * co))
      lv_plsun_arr[2] = (dxx_m * (sw * si) + dyy_m * (cw * si))
      obl_rad = earthobliquity(jtwok)
      co = math.cos(obl_rad)
      so = math.sin(obl_rad)
      lv_plgeo_arr[0] = lv_plsun_arr[0]
      lv_plgeo_arr[1] = co * lv_plsun_arr[1] - so * lv_plsun_arr[2]
      lv_plgeo_arr[2] = so * lv_plsun_arr[1] + co * lv_plsun_arr[2]
      retvalu = Kw.hypot3(lv_plsun_arr[0], lv_plsun_arr[1], lv_plsun_arr[2])
   return (retvalu)
def plhelio(indd):
   global lv_plsun_arr
   if (0 <= indd and indd < 3):
      retvalu = lv_plsun_arr[indd]
   else:
      retvalu = 0.0
   return (retvalu)
def plgeo(indd):
   global lv_plgeo_arr
   if (0 <= indd and indd < 3):
      retvalu = lv_plgeo_arr[indd]
   else:
      retvalu = 0.0
   return (retvalu)
def pl_name(plnt):
   plnt_ind = lf_pl_init(plnt)
   if (plnt_ind == LC_P1_SUN):
      print("SUN      ", end='')
   elif (plnt_ind == LC_P1_MERCURY):
      print("MERCURY  ", end='')
   elif (plnt_ind == LC_P1_VENUS):
      print("VENUS    ", end='')
   elif (plnt_ind == LC_P1_EARTH):
      print("EARTH    ", end='')
   elif (plnt_ind == LC_P1_MARS):
      print("MARS     ", end='')
   elif (plnt_ind == LC_P1_JUPITER):
      print("JUPITER  ", end='')
   elif (plnt_ind == LC_P1_SATURN):
      print("SATURN   ", end='')
   elif (plnt_ind == LC_P1_URANUS):
      print("URANUS   ", end='')
   elif (plnt_ind == LC_P1_NEPTUNE):
      print("NEPTUNE  ", end='')
   elif (plnt_ind == LC_P1_PLUTO):
      print("PLUTO    ", end='')
   elif (plnt_ind == LC_P1_CERES):
      print("CERES    ", end='')
   elif (plnt_ind == LC_P1_ERIS):
      print("ERIS     ", end='')
   elif (plnt_ind == LC_P1_MAKEMAKE):
      print("MAKEMAKE ", end='')
   elif (plnt_ind == LC_P1_HAUMEA):
      print("HAUMEA   ", end='')
   else:
      print("UNKNOWN", end='')
      print(str(plnt_ind), end='')
   return int(plnt_ind)
def plname():
   global lv_pl_ind
   return (pl_name(LC_P1_PREV_PL))
def earthradius(lat_deg):
   return (pl_aradius(LC_P1_EARTH, lat_deg))
def earthtropicalyear(jtwokdate):
   jy = jtwokdate * Kw.DAY / Kw.JYEAR
   return (((((2.64E-16) * jy - 7.29E-14) * jy - 6.15359E-8) * jy +\
            365.2421896698))
def earthdistance(lata_deg, lona_deg, latb_deg, lonb_deg):
   return (EARTH_A * Kw.great_circle_distance(Kw.deg2rad(lata_deg),\
            Kw.deg2rad(lona_deg), Kw.deg2rad(latb_deg),\
            Kw.deg2rad(lonb_deg)))
def plaradius(lat_deg):
   aa = Kw.square(pla())
   bb = Kw.square(plb())
   calat = Kw.square(pla() * Kw.cosd(lat_deg))
   sblat = Kw.square(plb() * Kw.sind(lat_deg))
   return (math.sqrt((aa * calat + bb * sblat) / (calat + sblat)))
def pl_aradius(plnt, lat_deg):
   pl(plnt)
   return (plaradius(lat_deg))
def earthobliquity(jtwok):
   tmill = jtwok * Kw.DAY / (1.0E+4 * Kw.JYEAR)
   ob_arcsec = (((((((((((2.45) * tmill + 5.79) * tmill + 27.8) * tmill +\
            7.12) * tmill - 39.05) * tmill - 249.67) * tmill - 51.38) *\
            tmill + 1999.25) * tmill - 1.55) * tmill - 4680.93) * tmill +\
            84381.448)
   return (Kw.sec2rad(ob_arcsec))
def earthprecession(jtwok):
   tmill = jtwok * Kw.DAY / (1.0E+4 * Kw.JYEAR)
   ob_arcsec = ((((((((((-8.66) * tmill - 47.59) * tmill + 24.24) * tmill\
            + 130.95) * tmill + 174.51) * tmill - 180.55) * tmill -\
            2353.16) * tmill + 77.32) * tmill + 11119.71) * tmill +\
            502909.66) * tmill + 0.0
   return (Kw.sec2rad(ob_arcsec))
EARTH_GRAVITYA = 9.7803253359 * Kw.MPSS
EARTH_GRAVITYB = 9.8321849378 * Kw.MPSS
def earthgravity(lat_deg):
   slatsq = Kw.square(Kw.sind(lat_deg))
   obltsq = EARTH_FLATNESS * (2.0 - EARTH_FLATNESS)
   kk = (((1.0 - EARTH_FLATNESS) * EARTH_GRAVITYB) - EARTH_GRAVITYA)
   return ((EARTH_GRAVITYA + kk * slatsq) / math.sqrt(1.0 - obltsq * slatsq))
def earthgravity_height(lat_deg, height_m):
   return ((earthgravity(lat_deg) - height_m * 2.0 * EARTH_GM /\
            Kw.cube(EARTH_A)))
LC_ISA_CNT = 12
LC_ISA_TEMP = 0
LC_ISA_PRES = 1
LC_ISA_DENS = 2
LC_ISA_HEIGHT = 3
LC_ISA_KEY_CNT = 4
lv_isa_mtrx = [[0 for ii in range(LC_ISA_KEY_CNT)] for ii in\
         range(LC_ISA_CNT)]
lv_isa_magic = 0.0
def lf_isa_calc(height_m, state_x):
   global lv_isa_mtrx
   global lv_isa_magic
   if (not Kw.ismagic(lv_isa_magic)):
      lv_isa_mtrx[0][LC_ISA_HEIGHT] = 0.0
      lv_isa_mtrx[0][LC_ISA_TEMP] = 288.15
      lv_isa_mtrx[0][LC_ISA_PRES] = Kw.ATM
      lv_isa_mtrx[0][LC_ISA_DENS] = 1.2250
      lv_isa_mtrx[1][LC_ISA_HEIGHT] = 1.1E+4
      lv_isa_mtrx[1][LC_ISA_TEMP] = 216.65
      lv_isa_mtrx[1][LC_ISA_PRES] = 22632.10
      lv_isa_mtrx[1][LC_ISA_DENS] = 0.36391
      lv_isa_mtrx[2][LC_ISA_HEIGHT] = 2.0E+4
      lv_isa_mtrx[2][LC_ISA_TEMP] = 216.65
      lv_isa_mtrx[2][LC_ISA_PRES] = 5474.89
      lv_isa_mtrx[2][LC_ISA_DENS] = 0.08803
      lv_isa_mtrx[3][LC_ISA_HEIGHT] = 3.2E+4
      lv_isa_mtrx[3][LC_ISA_TEMP] = 228.65
      lv_isa_mtrx[3][LC_ISA_PRES] = 868.02
      lv_isa_mtrx[3][LC_ISA_DENS] = 0.01322
      lv_isa_mtrx[4][LC_ISA_HEIGHT] = 4.7E+4
      lv_isa_mtrx[4][LC_ISA_TEMP] = 270.65
      lv_isa_mtrx[4][LC_ISA_PRES] = 110.91
      lv_isa_mtrx[4][LC_ISA_DENS] = 0.00143
      lv_isa_mtrx[5][LC_ISA_HEIGHT] = 5.1E+4
      lv_isa_mtrx[5][LC_ISA_TEMP] = 270.65
      lv_isa_mtrx[5][LC_ISA_PRES] = 66.94
      lv_isa_mtrx[5][LC_ISA_DENS] = 8.6E-4
      lv_isa_mtrx[6][LC_ISA_HEIGHT] = 7.1E+4
      lv_isa_mtrx[6][LC_ISA_TEMP] = 214.65
      lv_isa_mtrx[6][LC_ISA_PRES] = 3.96
      lv_isa_mtrx[6][LC_ISA_DENS] = 6.4E-5
      lv_isa_mtrx[7][LC_ISA_HEIGHT] = 84852
      lv_isa_mtrx[7][LC_ISA_TEMP] = 186.87
      lv_isa_mtrx[7][LC_ISA_PRES] = 0.3734
      lv_isa_mtrx[7][LC_ISA_DENS] = 7.0E-6
      lv_isa_mtrx[8][LC_ISA_HEIGHT] = 89700
      lv_isa_mtrx[8][LC_ISA_TEMP] = 186.87
      lv_isa_mtrx[8][LC_ISA_PRES] = 0.15
      lv_isa_mtrx[8][LC_ISA_DENS] = 3.0E-6
      lv_isa_mtrx[9][LC_ISA_HEIGHT] = 100400
      lv_isa_mtrx[9][LC_ISA_TEMP] = 199.55
      lv_isa_mtrx[9][LC_ISA_PRES] = 0.02
      lv_isa_mtrx[9][LC_ISA_DENS] = 5.0E-7
      lv_isa_mtrx[10][LC_ISA_HEIGHT] = 105000
      lv_isa_mtrx[10][LC_ISA_TEMP] = 217.65
      lv_isa_mtrx[10][LC_ISA_PRES] = 0.01
      lv_isa_mtrx[10][LC_ISA_DENS] = 2.0E-7
      lv_isa_mtrx[11][LC_ISA_HEIGHT] = 110000
      lv_isa_mtrx[11][LC_ISA_TEMP] = 263.95
      lv_isa_mtrx[11][LC_ISA_PRES] = 0.01
      lv_isa_mtrx[11][LC_ISA_DENS] = 1.0E-7
      lv_isa_magic = Kw.magicset()
   h_ind = LC_ISA_CNT - 1
   while (height_m < lv_isa_mtrx[h_ind][LC_ISA_HEIGHT] and 0 < h_ind):
      h_ind -= 1
   delta_h = height_m - lv_isa_mtrx[h_ind][LC_ISA_HEIGHT]
   if (h_ind < LC_ISA_CNT - 1):
      tdiff = lv_isa_mtrx[h_ind + 1][LC_ISA_TEMP] -\
               lv_isa_mtrx[h_ind][LC_ISA_TEMP]
      hdiff = lv_isa_mtrx[h_ind + 1][LC_ISA_HEIGHT] -\
               lv_isa_mtrx[h_ind][LC_ISA_HEIGHT]
      lapse_kpm = tdiff / hdiff
   else:
      lapse_kpm = 0.003
   this_temp = lv_isa_mtrx[h_ind][LC_ISA_TEMP] + lapse_kpm * delta_h
   if (state_x == LC_ISA_TEMP):
      retvalu = this_temp
   else:
      air_k_per_m = Kw.GRAVITY * Kwelements.AIR_MASS / Kw.GAS
      if (Kw.iszero(lapse_kpm)):
         retvalu = math.exp(-air_k_per_m * delta_h /\
                  lv_isa_mtrx[h_ind][LC_ISA_TEMP])
      else:
         expon = air_k_per_m / lapse_kpm
         if (state_x == LC_ISA_DENS):
            expon += 1
         retvalu = math.pow(lv_isa_mtrx[h_ind][LC_ISA_TEMP] / this_temp,\
                  expon)
      if (state_x == LC_ISA_PRES):
         retvalu *= lv_isa_mtrx[h_ind][LC_ISA_PRES]
      else:
         retvalu *= lv_isa_mtrx[h_ind][LC_ISA_DENS]
   return (retvalu)
def isa_temp(height_m):
   return (lf_isa_calc(height_m, LC_ISA_TEMP))
def isa_pres(height_m):
   return (lf_isa_calc(height_m, LC_ISA_PRES))
def isa_dens(height_m):
   return (lf_isa_calc(height_m, LC_ISA_DENS))
def vin_distance(lata_deg, lona_deg, latb_deg, lonb_deg, ret_bearings_arr_p):
   rad_arr = [0 for ii in range(2)]
   retvalu = EARTH_A * Kw.ellipsoid_distance(EARTH_FLATNESS,\
            Kw.deg2rad(lata_deg), Kw.deg2rad(lona_deg),\
            Kw.deg2rad(latb_deg), Kw.deg2rad(lonb_deg), rad_arr)
   ret_bearings_arr_p[0] = Kw.rad2deg(rad_arr[0])
   ret_bearings_arr_p[1] = Kw.rad2deg(rad_arr[1])
   return (retvalu)
def vin_destination(lata_deg, lona_deg, heading_deg, dist_m, ret_dest_arr_p):
   rad_arr = [0 for ii in range(2)]
   fltnss = EARTH_FLATNESS
   retvalu = Kw.ellipsoid_destination(fltnss, Kw.deg2rad(lata_deg),\
            Kw.deg2rad(lona_deg), Kw.deg2rad(heading_deg), dist_m /\
            EARTH_A, rad_arr)
   ret_dest_arr_p[0] = Kw.rad2deg(rad_arr[0])
   ret_dest_arr_p[1] = Kw.rad2deg(rad_arr[1])
   return (Kw.rad2deg(retvalu))
LC_PREM_DENS = 0
LC_PREM_MASS = 1
LC_PREM_XHEIGHT = 0
LC_PREM_XCOEA = 1
LC_PREM_XCOEB = 2
LC_PREM_XCOEC = 3
LC_PREM_XMASSD = 4
lv_prem_mtrx = [[0 for ii in range(6)] for ii in range(12)]
lv_prem_magic = 0.0
def lf_prem(height_m, state_x):
   if (not Kw.ismagic(lv_prem_magic)):
      lv_prem_mtrx[0][LC_PREM_XHEIGHT] = 0.0
      lv_prem_mtrx[0][LC_PREM_XCOEA] = 0.0
      lv_prem_mtrx[0][LC_PREM_XCOEB] = 0.0
      lv_prem_mtrx[0][LC_PREM_XCOEC] = 0.0
      lv_prem_mtrx[1][LC_PREM_XHEIGHT] = 1.2215E+6
      lv_prem_mtrx[1][LC_PREM_XCOEA] = 1.3088E+4
      lv_prem_mtrx[1][LC_PREM_XCOEB] = 1.911E-8
      lv_prem_mtrx[1][LC_PREM_XCOEC] = -2.1773E-10
      lv_prem_mtrx[2][LC_PREM_XHEIGHT] = 3.480E+6
      lv_prem_mtrx[2][LC_PREM_XCOEA] = 1.2346E+4
      lv_prem_mtrx[2][LC_PREM_XCOEB] = 1.3976E-4
      lv_prem_mtrx[2][LC_PREM_XCOEC] = -2.4123E-10
      lv_prem_mtrx[3][LC_PREM_XHEIGHT] = 3.630E+6
      lv_prem_mtrx[3][LC_PREM_XCOEA] = 7.3067E+3
      lv_prem_mtrx[3][LC_PREM_XCOEB] = -5.0007E-4
      lv_prem_mtrx[3][LC_PREM_XCOEC] = 0.0
      lv_prem_mtrx[4][LC_PREM_XHEIGHT] = 5.701E+6
      lv_prem_mtrx[4][LC_PREM_XCOEA] = 6.7823E+3
      lv_prem_mtrx[4][LC_PREM_XCOEB] = -2.4441E-4
      lv_prem_mtrx[4][LC_PREM_XCOEC] = -3.0922E-11
      lv_prem_mtrx[5][LC_PREM_XHEIGHT] = 5.771E+6
      lv_prem_mtrx[5][LC_PREM_XCOEA] = 5.3197E+3
      lv_prem_mtrx[5][LC_PREM_XCOEB] = -2.3286E-4
      lv_prem_mtrx[5][LC_PREM_XCOEC] = 0.0
      lv_prem_mtrx[6][LC_PREM_XHEIGHT] = 5.971E+6
      lv_prem_mtrx[6][LC_PREM_XCOEA] = 1.1249E+4
      lv_prem_mtrx[6][LC_PREM_XCOEB] = -1.2603E-3
      lv_prem_mtrx[6][LC_PREM_XCOEC] = 0.0
      lv_prem_mtrx[7][LC_PREM_XHEIGHT] = 6.151E+6
      lv_prem_mtrx[7][LC_PREM_XCOEA] = 7.1083E+3
      lv_prem_mtrx[7][LC_PREM_XCOEB] = -5.9706E-4
      lv_prem_mtrx[7][LC_PREM_XCOEC] = 0.0
      lv_prem_mtrx[8][LC_PREM_XHEIGHT] = 6.3466E+6
      lv_prem_mtrx[8][LC_PREM_XCOEA] = 2.691E+3
      lv_prem_mtrx[8][LC_PREM_XCOEB] = 1.0869E-4
      lv_prem_mtrx[8][LC_PREM_XCOEC] = 0.0
      lv_prem_mtrx[9][LC_PREM_XHEIGHT] = 6.356E+6
      lv_prem_mtrx[9][LC_PREM_XCOEA] = 2.9E+3
      lv_prem_mtrx[9][LC_PREM_XCOEB] = 0.0
      lv_prem_mtrx[9][LC_PREM_XCOEC] = 0.0
      lv_prem_mtrx[10][LC_PREM_XHEIGHT] = 6.368E+6
      lv_prem_mtrx[10][LC_PREM_XCOEA] = 2.6E+3
      lv_prem_mtrx[10][LC_PREM_XCOEB] = 0.0
      lv_prem_mtrx[10][LC_PREM_XCOEC] = 0.0
      lv_prem_mtrx[11][LC_PREM_XHEIGHT] = 6.371E+6
      lv_prem_mtrx[11][LC_PREM_XCOEA] = 1.02E+3
      lv_prem_mtrx[11][LC_PREM_XCOEB] = 0.0
      lv_prem_mtrx[11][LC_PREM_XCOEC] = 0.0
      lv_prem_mtrx[0][LC_PREM_XMASSD] = 0.0
      mass_i = 0.0
      for ii in range(1, 12, 1):
         hght_i = lv_prem_mtrx[ii - 1][LC_PREM_XHEIGHT]
         mass_b = 2.0 * Kw.TAU * hght_i * hght_i * hght_i *\
                  ((lv_prem_mtrx[ii][LC_PREM_XCOEC] / 5.0 * hght_i +\
                  lv_prem_mtrx[ii][LC_PREM_XCOEB] / 4.0) * hght_i +\
                  lv_prem_mtrx[ii][LC_PREM_XCOEA] / 3.0)
         hght_j = lv_prem_mtrx[ii][LC_PREM_XHEIGHT]
         mass_a = 2.0 * Kw.TAU * hght_j * hght_j * hght_j *\
                  ((lv_prem_mtrx[ii][LC_PREM_XCOEC] / 5.0 * hght_j +\
                  lv_prem_mtrx[ii][LC_PREM_XCOEB] / 4.0) * hght_j +\
                  lv_prem_mtrx[ii][LC_PREM_XCOEA] / 3.0)
         mass_ip = mass_i
         mass_i += (mass_a - mass_b)
         lv_prem_mtrx[ii][LC_PREM_XMASSD] = mass_ip - mass_b
      lv_prem_magic = Kw.magicset()
   if (height_m <= 0.0):
      retvalu = 0.0
   elif (EARTH_RADIUS < height_m):
      if (state_x == 0):
         retvalu = 0.0
      else:
         retvalu = EARTH_MASS
   else:
      ii = 0
      while (lv_prem_mtrx[ii][LC_PREM_XHEIGHT] < height_m):
         ii += 1
      coea = lv_prem_mtrx[ii][LC_PREM_XCOEA]
      coeb = lv_prem_mtrx[ii][LC_PREM_XCOEB]
      coec = lv_prem_mtrx[ii][LC_PREM_XCOEC]
      if (state_x == 0):
         retvalu = (coec * height_m + coeb) * height_m + coea
      elif (state_x == 1):
         hght_i = lv_prem_mtrx[ii][LC_PREM_XHEIGHT]
         coec /= 5.0
         coeb /= 4.0
         coea /= 3.0
         mass_a = 2.0 * Kw.TAU * height_m * height_m * height_m * ((coec\
                  * height_m + coeb) * height_m + coea)
         retvalu = mass_a + lv_prem_mtrx[ii][LC_PREM_XMASSD]
   return (retvalu)
def prem_density(height_m):
   return (lf_prem(height_m, LC_PREM_DENS))
def prem_mass(height_m):
   return (lf_prem(height_m, LC_PREM_MASS))
def prem_g(height_m):
   if (height_m <= 0.0):
      retvalu = 0.0
   else:
      retvalu = Kw.GRAVITATION * prem_mass(height_m) / (height_m * height_m)
   return (retvalu)
#   DDDDDDDDDDescription ############################ kwplanets_description #
def kwplanets_description():
   return( \
   "   Kwplanets Constants: ANOMALISTICYEAR CERES_A CERES_ASCENDING CERE" + \
   "S_ASCENDING_DT CERES_B CERES_C CERES_DAY CERES_DENSITY CERES_ECCENTR" + \
   "ICITY CERES_ECCENTRICITY_DT CERES_ESCAPE CERES_FLATNESS CERES_GM CER" + \
   "ES_GRAVITY CERES_INCLINATION CERES_INCLINATION_DT CERES_LONGITUDE CE" + \
   "RES_LONGITUDE_DT CERES_MASS CERES_OBLATENESS CERES_ORBIT CERES_ORBIT" + \
   "_DT CERES_PERIAPSIS CERES_PERIAPSIS_DT CERES_RADIUS CERES_SURFACE CE" + \
   "RES_SYNODIC CERES_VOLUME CERES_YEAR EARTH_A EARTH_ANOMALISTICYEAR EA" + \
   "RTH_ASCENDING EARTH_ASCENDING_DT EARTH_B EARTH_C EARTH_DAY EARTH_DEN" + \
   "SITY EARTH_ECCENTRICITY EARTH_ECCENTRICITY_DT EARTH_ESCAPE EARTH_FLA" + \
   "TNESS EARTH_GM EARTH_GRAVITY EARTH_GRAVITYA EARTH_GRAVITYB EARTH_INC" + \
   "LINATION EARTH_INCLINATION_DT EARTH_LONGITUDE EARTH_LONGITUDE_DT EAR" + \
   "TH_MASS EARTH_OBLATENESS EARTH_ORBIT EARTH_ORBIT_DT EARTH_PERIAPSIS " + \
   "EARTH_PERIAPSIS_DT EARTH_RADIUS EARTH_SIDEREALDAY EARTH_SIDEREALYEAR" + \
   " EARTH_SOLARDAY EARTH_STELLARDAY EARTH_SURFACE EARTH_THETA_0 EARTH_T" + \
   "ROPICALYEAR EARTH_VOLUME EARTH_YEAR ERIS_A ERIS_ASCENDING ERIS_ASCEN" + \
   "DING_DT ERIS_B ERIS_C ERIS_DAY ERIS_DENSITY ERIS_ECCENTRICITY ERIS_E" + \
   "CCENTRICITY_DT ERIS_ESCAPE ERIS_FLATNESS ERIS_GM ERIS_GRAVITY ERIS_I" + \
   "NCLINATION ERIS_INCLINATION_DT ERIS_LONGITUDE ERIS_LONGITUDE_DT ERIS" + \
   "_MASS ERIS_OBLATENESS ERIS_ORBIT ERIS_ORBIT_DT ERIS_PERIAPSIS ERIS_P" + \
   "ERIAPSIS_DT ERIS_RADIUS ERIS_SURFACE ERIS_SYNODIC ERIS_VOLUME ERIS_Y" + \
   "EAR HAUMEA_A HAUMEA_ASCENDING HAUMEA_ASCENDING_DT HAUMEA_B HAUMEA_C " + \
   "HAUMEA_DAY HAUMEA_DENSITY HAUMEA_ECCENTRICITY HAUMEA_ECCENTRICITY_DT" + \
   " HAUMEA_ESCAPE HAUMEA_FLATNESS HAUMEA_GM HAUMEA_GRAVITY HAUMEA_INCLI" + \
   "NATION HAUMEA_INCLINATION_DT HAUMEA_LONGITUDE HAUMEA_LONGITUDE_DT HA" + \
   "UMEA_MASS HAUMEA_OBLATENESS HAUMEA_ORBIT HAUMEA_ORBIT_DT HAUMEA_PERI" + \
   "APSIS HAUMEA_PERIAPSIS_DT HAUMEA_RADIUS HAUMEA_SURFACE HAUMEA_SYNODI" + \
   "C HAUMEA_VOLUME HAUMEA_YEAR JUPITER_A JUPITER_ASCENDING JUPITER_ASCE" + \
   "NDING_DT JUPITER_B JUPITER_C JUPITER_DAY JUPITER_DENSITY JUPITER_ECC" + \
   "ENTRICITY JUPITER_ECCENTRICITY_DT JUPITER_ESCAPE JUPITER_FLATNESS JU" + \
   "PITER_GM JUPITER_GRAVITY JUPITER_INCLINATION JUPITER_INCLINATION_DT " + \
   "JUPITER_LONGITUDE JUPITER_LONGITUDE_DT JUPITER_MASS JUPITER_OBLATENE" + \
   "SS JUPITER_ORBIT JUPITER_ORBIT_DT JUPITER_PERIAPSIS JUPITER_PERIAPSI" + \
   "S_DT JUPITER_RADIUS JUPITER_SURFACE JUPITER_SYNODIC JUPITER_VOLUME J" + \
   "UPITER_YEAR LC_ISA_CNT LC_ISA_DENS LC_ISA_HEIGHT LC_ISA_KEY_CNT LC_I" + \
   "SA_PRES LC_ISA_TEMP LC_P1_CERES LC_P1_CNT LC_P1_EARTH LC_P1_ERIS LC_" + \
   "P1_ERR LC_P1_HAUMEA LC_P1_JUPITER LC_P1_MAKEMAKE LC_P1_MARS LC_P1_ME" + \
   "RCURY LC_P1_NEPTUNE LC_P1_PLUTO LC_P1_PREV_PL LC_P1_SATURN LC_P1_SUN" + \
   " LC_P1_URANUS LC_P1_VENUS LC_P2_A LC_P2_ASC LC_P2_ASC_DT LC_P2_C LC_" + \
   "P2_CNT LC_P2_DAY LC_P2_ECC LC_P2_ECC_DT LC_P2_FLATNESS LC_P2_GM LC_P" + \
   "2_INC LC_P2_INC_DT LC_P2_LON LC_P2_LON_DT LC_P2_ORB LC_P2_ORB_DT LC_" + \
   "P2_PER LC_P2_PER_DT LC_P2_YEAR LC_PREM_DENS LC_PREM_MASS LC_PREM_XCO" + \
   "EA LC_PREM_XCOEB LC_PREM_XCOEC LC_PREM_XHEIGHT LC_PREM_XMASSD MAKEMA" + \
   "KE_A MAKEMAKE_ASCENDING MAKEMAKE_ASCENDING_DT MAKEMAKE_B MAKEMAKE_C " + \
   "MAKEMAKE_DAY MAKEMAKE_DENSITY MAKEMAKE_ECCENTRICITY MAKEMAKE_ECCENTR" + \
   "ICITY_DT MAKEMAKE_ESCAPE MAKEMAKE_FLATNESS MAKEMAKE_GM MAKEMAKE_GRAV" + \
   "ITY MAKEMAKE_INCLINATION MAKEMAKE_INCLINATION_DT MAKEMAKE_LONGITUDE " + \
   "MAKEMAKE_LONGITUDE_DT MAKEMAKE_MASS MAKEMAKE_OBLATENESS MAKEMAKE_ORB" + \
   "IT MAKEMAKE_ORBIT_DT MAKEMAKE_PERIAPSIS MAKEMAKE_PERIAPSIS_DT MAKEMA" + \
   "KE_RADIUS MAKEMAKE_SURFACE MAKEMAKE_SYNODIC MAKEMAKE_VOLUME MAKEMAKE" + \
   "_YEAR MARS_A MARS_ASCENDING MARS_ASCENDING_DT MARS_B MARS_C MARS_DAY" + \
   " MARS_DENSITY MARS_ECCENTRICITY MARS_ECCENTRICITY_DT MARS_ESCAPE MAR" + \
   "S_FLATNESS MARS_GM MARS_GRAVITY MARS_INCLINATION MARS_INCLINATION_DT" + \
   " MARS_LONGITUDE MARS_LONGITUDE_DT MARS_MASS MARS_OBLATENESS MARS_ORB" + \
   "IT MARS_ORBIT_DT MARS_PERIAPSIS MARS_PERIAPSIS_DT MARS_RADIUS MARS_S" + \
   "URFACE MARS_SYNODIC MARS_VOLUME MARS_YEAR MERCURY_A MERCURY_ASCENDIN" + \
   "G MERCURY_ASCENDING_DT MERCURY_B MERCURY_C MERCURY_DAY MERCURY_DENSI" + \
   "TY MERCURY_ECCENTRICITY MERCURY_ECCENTRICITY_DT MERCURY_ESCAPE MERCU" + \
   "RY_FLATNESS MERCURY_GM MERCURY_GRAVITY MERCURY_INCLINATION MERCURY_I" + \
   "NCLINATION_DT MERCURY_LONGITUDE MERCURY_LONGITUDE_DT MERCURY_MASS ME" + \
   "RCURY_OBLATENESS MERCURY_ORBIT MERCURY_ORBIT_DT MERCURY_PERIAPSIS ME" + \
   "RCURY_PERIAPSIS_DT MERCURY_RADIUS MERCURY_SURFACE MERCURY_SYNODIC ME" + \
   "RCURY_VOLUME MERCURY_YEAR MOON_A MOON_B MOON_C MOON_DAY MOON_DENSITY" + \
   " MOON_ECCENTRICITY MOON_ESCAPE MOON_FLATNESS MOON_GM MOON_GRAVITY MO" + \
   "ON_INCLINATION MOON_MASS MOON_OBLATENESS MOON_ORBIT MOON_RADIUS MOON" + \
   "_SURFACE MOON_SYNODIC MOON_VOLUME MOON_YEAR NEPTUNE_A NEPTUNE_ASCEND" + \
   "ING NEPTUNE_ASCENDING_DT NEPTUNE_B NEPTUNE_C NEPTUNE_DAY NEPTUNE_DEN" + \
   "SITY NEPTUNE_ECCENTRICITY NEPTUNE_ECCENTRICITY_DT NEPTUNE_ESCAPE NEP" + \
   "TUNE_FLATNESS NEPTUNE_GM NEPTUNE_GRAVITY NEPTUNE_INCLINATION NEPTUNE" + \
   "_INCLINATION_DT NEPTUNE_LONGITUDE NEPTUNE_LONGITUDE_DT NEPTUNE_MASS " + \
   "NEPTUNE_OBLATENESS NEPTUNE_ORBIT NEPTUNE_ORBIT_DT NEPTUNE_PERIAPSIS " + \
   "NEPTUNE_PERIAPSIS_DT NEPTUNE_RADIUS NEPTUNE_SURFACE NEPTUNE_SYNODIC " + \
   "NEPTUNE_VOLUME NEPTUNE_YEAR PLUTO_A PLUTO_ASCENDING PLUTO_ASCENDING_" + \
   "DT PLUTO_B PLUTO_C PLUTO_DAY PLUTO_DENSITY PLUTO_ECCENTRICITY PLUTO_" + \
   "ECCENTRICITY_DT PLUTO_ESCAPE PLUTO_FLATNESS PLUTO_GM PLUTO_GRAVITY P" + \
   "LUTO_INCLINATION PLUTO_INCLINATION_DT PLUTO_LONGITUDE PLUTO_LONGITUD" + \
   "E_DT PLUTO_MASS PLUTO_OBLATENESS PLUTO_ORBIT PLUTO_ORBIT_DT PLUTO_PE" + \
   "RIAPSIS PLUTO_PERIAPSIS_DT PLUTO_RADIUS PLUTO_SURFACE PLUTO_SYNODIC " + \
   "PLUTO_VOLUME PLUTO_YEAR SATURN_A SATURN_ASCENDING SATURN_ASCENDING_D" + \
   "T SATURN_B SATURN_C SATURN_DAY SATURN_DENSITY SATURN_ECCENTRICITY SA" + \
   "TURN_ECCENTRICITY_DT SATURN_ESCAPE SATURN_FLATNESS SATURN_GM SATURN_" + \
   "GRAVITY SATURN_INCLINATION SATURN_INCLINATION_DT SATURN_LONGITUDE SA" + \
   "TURN_LONGITUDE_DT SATURN_MASS SATURN_OBLATENESS SATURN_ORBIT SATURN_" + \
   "ORBIT_DT SATURN_PERIAPSIS SATURN_PERIAPSIS_DT SATURN_RADIUS SATURN_S" + \
   "URFACE SATURN_SYNODIC SATURN_VOLUME SATURN_YEAR SIDEREALYEAR SUN_A S" + \
   "UN_ASCENDING SUN_ASCENDING_DT SUN_B SUN_C SUN_DAY SUN_DENSITY SUN_EC" + \
   "CENTRICITY SUN_ECCENTRICITY_DT SUN_ESCAPE SUN_FLATNESS SUN_GM SUN_GM" + \
   "IERS SUN_GMNASA SUN_GRAVITY SUN_INCLINATION SUN_INCLINATION_DT SUN_L" + \
   "ONGITUDE SUN_LONGITUDE_DT SUN_MASS SUN_OBLATENESS SUN_ORBIT SUN_ORBI" + \
   "T_DT SUN_PERIAPSIS SUN_PERIAPSIS_DT SUN_RADIUS SUN_SURFACE SUN_VOLUM" + \
   "E SUN_YEAR TROPICALYEAR URANUS_A URANUS_ASCENDING URANUS_ASCENDING_D" + \
   "T URANUS_B URANUS_C URANUS_DAY URANUS_DENSITY URANUS_ECCENTRICITY UR" + \
   "ANUS_ECCENTRICITY_DT URANUS_ESCAPE URANUS_FLATNESS URANUS_GM URANUS_" + \
   "GRAVITY URANUS_INCLINATION URANUS_INCLINATION_DT URANUS_LONGITUDE UR" + \
   "ANUS_LONGITUDE_DT URANUS_MASS URANUS_OBLATENESS URANUS_ORBIT URANUS_" + \
   "ORBIT_DT URANUS_PERIAPSIS URANUS_PERIAPSIS_DT URANUS_RADIUS URANUS_S" + \
   "URFACE URANUS_SYNODIC URANUS_VOLUME URANUS_YEAR VENUS_A VENUS_ASCEND" + \
   "ING VENUS_ASCENDING_DT VENUS_B VENUS_C VENUS_DAY VENUS_DENSITY VENUS" + \
   "_ECCENTRICITY VENUS_ECCENTRICITY_DT VENUS_ESCAPE VENUS_FLATNESS VENU" + \
   "S_GM VENUS_GRAVITY VENUS_INCLINATION VENUS_INCLINATION_DT VENUS_LONG" + \
   "ITUDE VENUS_LONGITUDE_DT VENUS_MASS VENUS_OBLATENESS VENUS_ORBIT VEN" + \
   "US_ORBIT_DT VENUS_PERIAPSIS VENUS_PERIAPSIS_DT VENUS_RADIUS VENUS_SU" + \
   "RFACE VENUS_SYNODIC VENUS_VOLUME VENUS_YEAR" + \
   "\n" + \
   "   Kwplanets 0-ary Functions: pla plaphelion plargument plascending " + \
   "plb plc plday pldensity pleccentricanomaly pleccentricity plescape p" + \
   "lflatness plgm plgravity plinclination pllongitude plmargot plmass p" + \
   "lmeananomaly plname plorbit plperiapsis plperihelion plradius plster" + \
   "nlevison plsurface plsynodic plvolume plyear" + \
   "\n" + \
   "   Kwplanets 1-ary Functions: earthgravity earthobliquity earthprece" + \
   "ssion earthradius earthtropicalyear isa_dens isa_pres isa_temp pl pl" + \
   "_a pl_aphelion pl_argument pl_ascending pl_b pl_c pl_day pl_density " + \
   "pl_eccentricanomaly pl_eccentricity pl_escape pl_flatness pl_gm pl_g" + \
   "ravity pl_inclination pl_longitude pl_margot pl_mass pl_meananomaly " + \
   "pl_name pl_orbit pl_periapsis pl_perihelion pl_radius pl_sternleviso" + \
   "n pl_surface pl_synodic pl_volume pl_year plaradius plgeo plhelio pl" + \
   "settime prem_density prem_g prem_mass" + \
   "\n" + \
   "   Kwplanets 2-ary Functions: earthgravity_height eccentric_anomaly " + \
   "margot orbit_v orbitgm_v pl_aradius pl_heliocentric sternlevison" + \
   "\n" + \
   "   Kwplanets 4-ary Functions: earthdistance" + \
   "\n" + \
   "   Kwplanets 5-ary Functions: vin_destination vin_distance" + \
   "\n"
)
def kwplanets_desc():
   return( \
   "   Kwplanets Constants: ANOMALISTICYEAR CERES_(A(SCENDING(_DT)?)?|B|" + \
   "C|D(AY|ENSITY)|E(CCENTRICITY(_DT)?|SCAPE)|FLATNESS|G(M|RAVITY)|INCLI" + \
   "NATION(_DT)?|LONGITUDE(_DT)?|MASS|O(BLATENESS|RBIT(_DT)?)|PERIAPSIS(" + \
   "_DT)?|RADIUS|S(URFACE|YNODIC)|VOLUME|YEAR) EARTH_(A(NOMALISTICYEAR|S" + \
   "CENDING(_DT)?)?|B|C|D(AY|ENSITY)|E(CCENTRICITY(_DT)?|SCAPE)|FLATNESS" + \
   "|G(M|RAVITY[AB]?)|INCLINATION(_DT)?|LONGITUDE(_DT)?|MASS|O(BLATENESS" + \
   "|RBIT(_DT)?)|PERIAPSIS(_DT)?|RADIUS|S(IDEREAL(DAY|YEAR)|OLARDAY|TELL" + \
   "ARDAY|URFACE)|T(HETA_0|ROPICALYEAR)|VOLUME|YEAR) ERIS_(A(SCENDING(_D" + \
   "T)?)?|B|C|D(AY|ENSITY)|E(CCENTRICITY(_DT)?|SCAPE)|FLATNESS|G(M|RAVIT" + \
   "Y)|INCLINATION(_DT)?|LONGITUDE(_DT)?|MASS|O(BLATENESS|RBIT(_DT)?)|PE" + \
   "RIAPSIS(_DT)?|RADIUS|S(URFACE|YNODIC)|VOLUME|YEAR) HAUMEA_(A(SCENDIN" + \
   "G(_DT)?)?|B|C|D(AY|ENSITY)|E(CCENTRICITY(_DT)?|SCAPE)|FLATNESS|G(M|R" + \
   "AVITY)|INCLINATION(_DT)?|LONGITUDE(_DT)?|MASS|O(BLATENESS|RBIT(_DT)?" + \
   ")|PERIAPSIS(_DT)?|RADIUS|S(URFACE|YNODIC)|VOLUME|YEAR) JUPITER_(A(SC" + \
   "ENDING(_DT)?)?|B|C|D(AY|ENSITY)|E(CCENTRICITY(_DT)?|SCAPE)|FLATNESS|" + \
   "G(M|RAVITY)|INCLINATION(_DT)?|LONGITUDE(_DT)?|MASS|O(BLATENESS|RBIT(" + \
   "_DT)?)|PERIAPSIS(_DT)?|RADIUS|S(URFACE|YNODIC)|VOLUME|YEAR) LC_(ISA_" + \
   "(CNT|DENS|HEIGHT|KEY_CNT|PRES|TEMP)|P(1_(C(ERES|NT)|E(ARTH|R(IS|R))|" + \
   "HAUMEA|JUPITER|M(A(KEMAKE|RS)|ERCURY)|NEPTUNE|P(LUTO|REV_PL)|S(ATURN" + \
   "|UN)|URANUS|VENUS)|2_(A(SC(_DT)?)?|C(NT)?|DAY|ECC(_DT)?|FLATNESS|GM|" + \
   "INC(_DT)?|LON(_DT)?|ORB(_DT)?|PER(_DT)?|YEAR)|REM_(DENS|MASS|X(COE[A" + \
   "BC]|HEIGHT|MASSD)))) MAKEMAKE_(A(SCENDING(_DT)?)?|B|C|D(AY|ENSITY)|E" + \
   "(CCENTRICITY(_DT)?|SCAPE)|FLATNESS|G(M|RAVITY)|INCLINATION(_DT)?|LON" + \
   "GITUDE(_DT)?|MASS|O(BLATENESS|RBIT(_DT)?)|PERIAPSIS(_DT)?|RADIUS|S(U" + \
   "RFACE|YNODIC)|VOLUME|YEAR) MARS_(A(SCENDING(_DT)?)?|B|C|D(AY|ENSITY)" + \
   "|E(CCENTRICITY(_DT)?|SCAPE)|FLATNESS|G(M|RAVITY)|INCLINATION(_DT)?|L" + \
   "ONGITUDE(_DT)?|MASS|O(BLATENESS|RBIT(_DT)?)|PERIAPSIS(_DT)?|RADIUS|S" + \
   "(URFACE|YNODIC)|VOLUME|YEAR) MERCURY_(A(SCENDING(_DT)?)?|B|C|D(AY|EN" + \
   "SITY)|E(CCENTRICITY(_DT)?|SCAPE)|FLATNESS|G(M|RAVITY)|INCLINATION(_D" + \
   "T)?|LONGITUDE(_DT)?|MASS|O(BLATENESS|RBIT(_DT)?)|PERIAPSIS(_DT)?|RAD" + \
   "IUS|S(URFACE|YNODIC)|VOLUME|YEAR) MOON_([ABC]|D(AY|ENSITY)|E(CCENTRI" + \
   "CITY|SCAPE)|FLATNESS|G(M|RAVITY)|INCLINATION|MASS|O(BLATENESS|RBIT)|" + \
   "RADIUS|S(URFACE|YNODIC)|VOLUME|YEAR) NEPTUNE_(A(SCENDING(_DT)?)?|B|C" + \
   "|D(AY|ENSITY)|E(CCENTRICITY(_DT)?|SCAPE)|FLATNESS|G(M|RAVITY)|INCLIN" + \
   "ATION(_DT)?|LONGITUDE(_DT)?|MASS|O(BLATENESS|RBIT(_DT)?)|PERIAPSIS(_" + \
   "DT)?|RADIUS|S(URFACE|YNODIC)|VOLUME|YEAR) PLUTO_(A(SCENDING(_DT)?)?|" + \
   "B|C|D(AY|ENSITY)|E(CCENTRICITY(_DT)?|SCAPE)|FLATNESS|G(M|RAVITY)|INC" + \
   "LINATION(_DT)?|LONGITUDE(_DT)?|MASS|O(BLATENESS|RBIT(_DT)?)|PERIAPSI" + \
   "S(_DT)?|RADIUS|S(URFACE|YNODIC)|VOLUME|YEAR) SATURN_(A(SCENDING(_DT)" + \
   "?)?|B|C|D(AY|ENSITY)|E(CCENTRICITY(_DT)?|SCAPE)|FLATNESS|G(M|RAVITY)" + \
   "|INCLINATION(_DT)?|LONGITUDE(_DT)?|MASS|O(BLATENESS|RBIT(_DT)?)|PERI" + \
   "APSIS(_DT)?|RADIUS|S(URFACE|YNODIC)|VOLUME|YEAR) SIDEREALYEAR SUN_(A" + \
   "(SCENDING(_DT)?)?|B|C|D(AY|ENSITY)|E(CCENTRICITY(_DT)?|SCAPE)|FLATNE" + \
   "SS|G(M(IERS|NASA)?|RAVITY)|INCLINATION(_DT)?|LONGITUDE(_DT)?|MASS|O(" + \
   "BLATENESS|RBIT(_DT)?)|PERIAPSIS(_DT)?|RADIUS|SURFACE|VOLUME|YEAR) TR" + \
   "OPICALYEAR URANUS_(A(SCENDING(_DT)?)?|B|C|D(AY|ENSITY)|E(CCENTRICITY" + \
   "(_DT)?|SCAPE)|FLATNESS|G(M|RAVITY)|INCLINATION(_DT)?|LONGITUDE(_DT)?" + \
   "|MASS|O(BLATENESS|RBIT(_DT)?)|PERIAPSIS(_DT)?|RADIUS|S(URFACE|YNODIC" + \
   ")|VOLUME|YEAR) VENUS_(A(SCENDING(_DT)?)?|B|C|D(AY|ENSITY)|E(CCENTRIC" + \
   "ITY(_DT)?|SCAPE)|FLATNESS|G(M|RAVITY)|INCLINATION(_DT)?|LONGITUDE(_D" + \
   "T)?|MASS|O(BLATENESS|RBIT(_DT)?)|PERIAPSIS(_DT)?|RADIUS|S(URFACE|YNO" + \
   "DIC)|VOLUME|YEAR)" + \
   "\n" + \
   "   Kwplanets 0-ary Functions: pla(phelion|rgument|scending)? plb plc" + \
   " pld(ay|ensity) ple(ccentric(anomaly|ity)|scape) plflatness plg(m|ra" + \
   "vity) plinclination pllongitude plm(a(rgot|ss)|eananomaly) plname pl" + \
   "orbit plperi(apsis|helion) plradius pls(ternlevison|urface|ynodic) p" + \
   "lvolume plyear" + \
   "\n" + \
   "   Kwplanets 1-ary Functions: earth(gravity|obliquity|precession|rad" + \
   "ius|tropicalyear) isa_(dens|pres|temp) pl pl_(a(phelion|rgument|scen" + \
   "ding)?|b|c|d(ay|ensity)|e(ccentric(anomaly|ity)|scape)|flatness|g(m|" + \
   "ravity)|inclination|longitude|m(a(rgot|ss)|eananomaly)|name|orbit|pe" + \
   "ri(apsis|helion)|radius|s(ternlevison|urface|ynodic)|volume|year) pl" + \
   "aradius plgeo plhelio plsettime prem_(density|g|mass)" + \
   "\n" + \
   "   Kwplanets 2-ary Functions: earthgravity_height eccentric_anomaly " + \
   "margot orbit(_v|gm_v) pl_(aradius|heliocentric) sternlevison" + \
   "\n" + \
   "   Kwplanets 4-ary Functions: earthdistance" + \
   "\n" + \
   "   Kwplanets 5-ary Functions: vin_d(estination|istance)" + \
   "\n"
)
