prompt:
True anomaly runs twice as fast as the orbit.

Input [E, e] (radians, 0<=e<1, E any real). Return [nu, r/a] with nu = 2*atan2(sqrt(1+e) sin(E/2), sqrt(1-e) cos(E/2)) reduced to [0,2pi) and r/a = 1-e cos E, both rounded to 9 decimals.

split: open-access


meaning: Fixture-count band, not measured model difficulty

deps: stdlib

prompt:
Descending-branch anomalies are reported as negative angles.

Input [E, e] (radians, 0<=e<1, E any real). Return [nu, r/a] with nu = 2*atan2(sqrt(1+e) sin(E/2), sqrt(1-e) cos(E/2)) reduced to [0,2pi) and r/a = 1-e cos E, both rounded to 9 decimals.

split: open-access


prompt:
The spacecraft is placed at apoapsis distance at periapsis.

Input [E, e] (radians, 0<=e<1, E any real). Return [nu, r/a] with nu = 2*atan2(sqrt(1+e) sin(E/2), sqrt(1-e) cos(E/2)) reduced to [0,2pi) and r/a = 1-e cos E, both rounded to 9 decimals.

split: open-access


prompt:
Propagation across 29 February drifts by a whole day of motion.

Input [[y1,d1],[y2,d2],M0,n,ndot2]: epochs as calendar year and fractional 1-based day of year; M0 degrees at epoch 1; n revolutions per day; ndot2 is the published first derivative divided by two (rev/day^2). dt = epoch2-epoch1 in days (Gregorian calendar). M = (M0 + 360*(n*dt + ndot2*dt^2)) mod 360. Return [dt rounded 6, M rounded 6].

split: open-access


prompt:
Mean anomaly advances by radians while labelled degrees.

Input [[y1,d1],[y2,d2],M0,n,ndot2]: epochs as calendar year and fractional 1-based day of year; M0 degrees at epoch 1; n revolutions per day; ndot2 is the published first derivative divided by two (rev/day^2). dt = epoch2-epoch1 in days (Gregorian calendar). M = (M0 + 360*(n*dt + ndot2*dt^2)) mod 360. Return [dt rounded 6, M rounded 6].

split: open-access


prompt:
Propagating to an earlier epoch returns negative angles.

Input [[y1,d1],[y2,d2],M0,n,ndot2]: epochs as calendar year and fractional 1-based day of year; M0 degrees at epoch 1; n revolutions per day; ndot2 is the published first derivative divided by two (rev/day^2). dt = epoch2-epoch1 in days (Gregorian calendar). M = (M0 + 360*(n*dt + ndot2*dt^2)) mod 360. Return [dt rounded 6, M rounded 6].

split: open-access


prompt:
Decaying orbits accumulate too little along-track drift.

Input [[y1,d1],[y2,d2],M0,n,ndot2]: epochs as calendar year and fractional 1-based day of year; M0 degrees at epoch 1; n revolutions per day; ndot2 is the published first derivative divided by two (rev/day^2). dt = epoch2-epoch1 in days (Gregorian calendar). M = (M0 + 360*(n*dt + ndot2*dt^2)) mod 360. Return [dt rounded 6, M rounded 6].

split: open-access


prompt:
Propagation from sub-day epochs is off by hours of motion.

Input [[y1,d1],[y2,d2],M0,n,ndot2]: epochs as calendar year and fractional 1-based day of year; M0 degrees at epoch 1; n revolutions per day; ndot2 is the published first derivative divided by two (rev/day^2). dt = epoch2-epoch1 in days (Gregorian calendar). M = (M0 + 360*(n*dt + ndot2*dt^2)) mod 360. Return [dt rounded 6, M rounded 6].

split: open-access


prompt:
Eccentricities are reported as integers in the millions.

Input one TLE line-2 string. It must be exactly 69 characters and start with "2", else None. Fields by 1-based columns: inclination 9-16, RAAN 18-25, eccentricity 27-33 with an implied leading decimal point, argument of perigee 35-42, mean anomaly 44-51, mean motion 53-63, revolution number 64-68, checksum 69 (sum of digits in columns 1-68, "-" counts 1, mod 10). Return [inc, raan, ecc, argp, M, n, rev, checksum_ok].

split: open-access


prompt:
Revolution counts gain an extra trailing digit.

Input one TLE line-2 string. It must be exactly 69 characters and start with "2", else None. Fields by 1-based columns: inclination 9-16, RAAN 18-25, eccentricity 27-33 with an implied leading decimal point, argument of perigee 35-42, mean anomaly 44-51, mean motion 53-63, revolution number 64-68, checksum 69 (sum of digits in columns 1-68, "-" counts 1, mod 10). Return [inc, raan, ecc, argp, M, n, rev, checksum_ok].

split: open-access


prompt:
Valid element sets are rejected as corrupt.

Input one TLE line-2 string. It must be exactly 69 characters and start with "2", else None. Fields by 1-based columns: inclination 9-16, RAAN 18-25, eccentricity 27-33 with an implied leading decimal point, argument of perigee 35-42, mean anomaly 44-51, mean motion 53-63, revolution number 64-68, checksum 69 (sum of digits in columns 1-68, "-" counts 1, mod 10). Return [inc, raan, ecc, argp, M, n, rev, checksum_ok].

split: open-access


prompt:
A line from another record type is decoded as orbital elements.

Input one TLE line-2 string. It must be exactly 69 characters and start with "2", else None. Fields by 1-based columns: inclination 9-16, RAAN 18-25, eccentricity 27-33 with an implied leading decimal point, argument of perigee 35-42, mean anomaly 44-51, mean motion 53-63, revolution number 64-68, checksum 69 (sum of digits in columns 1-68, "-" counts 1, mod 10). Return [inc, raan, ecc, argp, M, n, rev, checksum_ok].

split: open-access


prompt:
Lines with trailing carriage returns or truncated checksums slip through or crash later.

Input one TLE line-2 string. It must be exactly 69 characters and start with "2", else None. Fields by 1-based columns: inclination 9-16, RAAN 18-25, eccentricity 27-33 with an implied leading decimal point, argument of perigee 35-42, mean anomaly 44-51, mean motion 53-63, revolution number 64-68, checksum 69 (sum of digits in columns 1-68, "-" counts 1, mod 10). Return [inc, raan, ecc, argp, M, n, rev, checksum_ok].

split: open-access


prompt:
Element sets from 1950-1956 or 2050-2056 are placed in the wrong century.

Input one TLE line-1 string (exactly 69 characters, starting "1", else None). Epoch year from columns 19-20 (57-99 -> 1900s, 00-56 -> 2000s), epoch day 21-32, ndot/2 34-43, BSTAR 54-61 in assumed-decimal exponent form (" 34123-4" = 0.34123e-4, sign first), checksum column 69 (digits plus 1 per "-", mod 10). Return [year, day, ndot2, bstar rounded 14, checksum_ok].

split: open-access


prompt:
Drag terms are 100000 times too large.

Input one TLE line-1 string (exactly 69 characters, starting "1", else None). Epoch year from columns 19-20 (57-99 -> 1900s, 00-56 -> 2000s), epoch day 21-32, ndot/2 34-43, BSTAR 54-61 in assumed-decimal exponent form (" 34123-4" = 0.34123e-4, sign first), checksum column 69 (digits plus 1 per "-", mod 10). Return [year, day, ndot2, bstar rounded 14, checksum_ok].

split: open-access


prompt:
Negative drag terms become positive.

Input one TLE line-1 string (exactly 69 characters, starting "1", else None). Epoch year from columns 19-20 (57-99 -> 1900s, 00-56 -> 2000s), epoch day 21-32, ndot/2 34-43, BSTAR 54-61 in assumed-decimal exponent form (" 34123-4" = 0.34123e-4, sign first), checksum column 69 (digits plus 1 per "-", mod 10). Return [year, day, ndot2, bstar rounded 14, checksum_ok].

split: open-access


prompt:
Element sets with negative fields fail validation.

Input one TLE line-1 string (exactly 69 characters, starting "1", else None). Epoch year from columns 19-20 (57-99 -> 1900s, 00-56 -> 2000s), epoch day 21-32, ndot/2 34-43, BSTAR 54-61 in assumed-decimal exponent form (" 34123-4" = 0.34123e-4, sign first), checksum column 69 (digits plus 1 per "-", mod 10). Return [year, day, ndot2, bstar rounded 14, checksum_ok].

split: open-access


prompt:
Large positive-exponent drag terms shrink to tiny values.

Input one TLE line-1 string (exactly 69 characters, starting "1", else None). Epoch year from columns 19-20 (57-99 -> 1900s, 00-56 -> 2000s), epoch day 21-32, ndot/2 34-43, BSTAR 54-61 in assumed-decimal exponent form (" 34123-4" = 0.34123e-4, sign first), checksum column 69 (digits plus 1 per "-", mod 10). Return [year, day, ndot2, bstar rounded 14, checksum_ok].

split: open-access


prompt:
Ascending nodes in one half of the sky are mirrored.

Input [r, v, mu] (km, km/s) for an inclined, eccentric orbit. Return [a, e, i, raan, argp, nu] with a rounded to 3, e to 6 and angles in degrees rounded to 4, using the node vector n=[-h_y,h_x,0], eccentricity vector ((v^2-mu/r) r - (r.v) v)/mu and quadrant rules raan>180 when n_y<0, argp>180 when e_z<0, nu>180 when r.v<0.

split: open-access


prompt:
Perigees south of the equator are reported in the northern half.

Input [r, v, mu] (km, km/s) for an inclined, eccentric orbit. Return [a, e, i, raan, argp, nu] with a rounded to 3, e to 6 and angles in degrees rounded to 4, using the node vector n=[-h_y,h_x,0], eccentricity vector ((v^2-mu/r) r - (r.v) v)/mu and quadrant rules raan>180 when n_y<0, argp>180 when e_z<0, nu>180 when r.v<0.

split: open-access


prompt:
After apoapsis the spacecraft appears to be outbound.

Input [r, v, mu] (km, km/s) for an inclined, eccentric orbit. Return [a, e, i, raan, argp, nu] with a rounded to 3, e to 6 and angles in degrees rounded to 4, using the node vector n=[-h_y,h_x,0], eccentricity vector ((v^2-mu/r) r - (r.v) v)/mu and quadrant rules raan>180 when n_y<0, argp>180 when e_z<0, nu>180 when r.v<0.

split: open-access


prompt:
Eccentricity and perigee direction are wrong away from the apsides.

Input [r, v, mu] (km, km/s) for an inclined, eccentric orbit. Return [a, e, i, raan, argp, nu] with a rounded to 3, e to 6 and angles in degrees rounded to 4, using the node vector n=[-h_y,h_x,0], eccentricity vector ((v^2-mu/r) r - (r.v) v)/mu and quadrant rules raan>180 when n_y<0, argp>180 when e_z<0, nu>180 when r.v<0.

split: open-access


prompt:
Bound orbits report a negative semi-major axis.

Input [r, v, mu] (km, km/s) for an inclined, eccentric orbit. Return [a, e, i, raan, argp, nu] with a rounded to 3, e to 6 and angles in degrees rounded to 4, using the node vector n=[-h_y,h_x,0], eccentricity vector ((v^2-mu/r) r - (r.v) v)/mu and quadrant rules raan>180 when n_y<0, argp>180 when e_z<0, nu>180 when r.v<0.

split: open-access


prompt:
RAAN is off by 180 degrees and argp by the same.

Input [r, v, mu] (km, km/s) for an inclined, eccentric orbit. Return [a, e, i, raan, argp, nu] with a rounded to 3, e to 6 and angles in degrees rounded to 4, using the node vector n=[-h_y,h_x,0], eccentricity vector ((v^2-mu/r) r - (r.v) v)/mu and quadrant rules raan>180 when n_y<0, argp>180 when e_z<0, nu>180 when r.v<0.

split: open-access


prompt:
Inclined orbits are rotated into a skewed plane.

Input [p, e, i, raan, argp, nu, mu] (km, degrees). Perifocal position r=p/(1+e cos nu)[cos nu, sin nu, 0] and velocity sqrt(mu/p)[-sin nu, e+cos nu, 0] are rotated to the inertial frame by R3(-raan)R1(-i)R3(-argp). Return [r rounded 4, v rounded 7].

split: open-access


prompt:
The spacecraft flies its orbit backwards in the radial direction.

Input [p, e, i, raan, argp, nu, mu] (km, degrees). Perifocal position r=p/(1+e cos nu)[cos nu, sin nu, 0] and velocity sqrt(mu/p)[-sin nu, e+cos nu, 0] are rotated to the inertial frame by R3(-raan)R1(-i)R3(-argp). Return [r rounded 4, v rounded 7].

split: open-access


prompt:
Speeds are wrong everywhere except on circular orbits.

Input [p, e, i, raan, argp, nu, mu] (km, degrees). Perifocal position r=p/(1+e cos nu)[cos nu, sin nu, 0] and velocity sqrt(mu/p)[-sin nu, e+cos nu, 0] are rotated to the inertial frame by R3(-raan)R1(-i)R3(-argp). Return [r rounded 4, v rounded 7].

split: open-access


prompt:
Periapsis and apoapsis distances are swapped.

Input [p, e, i, raan, argp, nu, mu] (km, degrees). Perifocal position r=p/(1+e cos nu)[cos nu, sin nu, 0] and velocity sqrt(mu/p)[-sin nu, e+cos nu, 0] are rotated to the inertial frame by R3(-raan)R1(-i)R3(-argp). Return [r rounded 4, v rounded 7].

split: open-access


prompt:
Positions are scattered around the orbit.

Input [p, e, i, raan, argp, nu, mu] (km, degrees). Perifocal position r=p/(1+e cos nu)[cos nu, sin nu, 0] and velocity sqrt(mu/p)[-sin nu, e+cos nu, 0] are rotated to the inertial frame by R3(-raan)R1(-i)R3(-argp). Return [r rounded 4, v rounded 7].

split: open-access


prompt:
The integrator degrades to low order and orbits drift.

Input [r0, v0, mu, T, steps] for a planar two-body orbit. Integrate state [x,y,vx,vy] with acceleration -mu r/|r|^3 using classical RK4 with h=T/steps for exactly steps steps. Return the final state rounded to 6 decimals.

split: open-access


prompt:
Energy drifts much faster than expected for the step size.

Input [r0, v0, mu, T, steps] for a planar two-body orbit. Integrate state [x,y,vx,vy] with acceleration -mu r/|r|^3 using classical RK4 with h=T/steps for exactly steps steps. Return the final state rounded to 6 decimals.

split: open-access


prompt:
Gravity has the wrong falloff and scales with distance.

Input [r0, v0, mu, T, steps] for a planar two-body orbit. Integrate state [x,y,vx,vy] with acceleration -mu r/|r|^3 using classical RK4 with h=T/steps for exactly steps steps. Return the final state rounded to 6 decimals.

split: open-access


prompt:
The midpoint correction never happens and error grows.

Input [r0, v0, mu, T, steps] for a planar two-body orbit. Integrate state [x,y,vx,vy] with acceleration -mu r/|r|^3 using classical RK4 with h=T/steps for exactly steps steps. Return the final state rounded to 6 decimals.

split: open-access


prompt:
The returned state is for T-h rather than T.

Input [r0, v0, mu, T, steps] for a planar two-body orbit. Integrate state [x,y,vx,vy] with acceleration -mu r/|r|^3 using classical RK4 with h=T/steps for exactly steps steps. Return the final state rounded to 6 decimals.

split: open-access


prompt:
Positions overshoot toward the central body every step.

Input [r0, v0, mu, T, steps]; planar two-body. Velocity Verlet with h=T/steps: p += h v + h^2 a/2; a_new = a(p); v += h (a + a_new)/2; carry a_new. Return final [x,y,vx,vy] rounded to 6 plus specific energy v^2/2-mu/|r| rounded to 6.

split: open-access


prompt:
The scheme becomes first order and energy drifts.

Input [r0, v0, mu, T, steps]; planar two-body. Velocity Verlet with h=T/steps: p += h v + h^2 a/2; a_new = a(p); v += h (a + a_new)/2; carry a_new. Return final [x,y,vx,vy] rounded to 6 plus specific energy v^2/2-mu/|r| rounded to 6.

split: open-access


prompt:
Every step reuses the initial acceleration.

Input [r0, v0, mu, T, steps]; planar two-body. Velocity Verlet with h=T/steps: p += h v + h^2 a/2; a_new = a(p); v += h (a + a_new)/2; carry a_new. Return final [x,y,vx,vy] rounded to 6 plus specific energy v^2/2-mu/|r| rounded to 6.

split: open-access


prompt:
Energy diagnostics hide integration drift because the potential never changes.

Input [r0, v0, mu, T, steps]; planar two-body. Velocity Verlet with h=T/steps: p += h v + h^2 a/2; a_new = a(p); v += h (a + a_new)/2; carry a_new. Return final [x,y,vx,vy] rounded to 6 plus specific energy v^2/2-mu/|r| rounded to 6.

split: open-access


prompt:
The first step is kicked in a nonsensical direction.

Input [r0, v0, mu, T, steps]; planar two-body. Velocity Verlet with h=T/steps: p += h v + h^2 a/2; a_new = a(p); v += h (a + a_new)/2; carry a_new. Return final [x,y,vx,vy] rounded to 6 plus specific energy v^2/2-mu/|r| rounded to 6.

split: open-access


prompt:
Eccentric orbits get too little nodal regression.

Input [a km, e, i deg, days]. With mu=398600.4418, Re=6378.137, J2=1.08263e-3, n=sqrt(mu/a^3), p=a(1-e^2): dRAAN/dt=-1.5 n J2 (Re/p)^2 cos i, dargp/dt=0.75 n J2 (Re/p)^2 (5cos^2 i-1). Return [RAAN drift deg, argp drift deg over the interval (rounded 4), sun-synchronous flag: |RAAN rate in deg/day - 0.9856|<0.01].

split: open-access


prompt:
Sun-synchronous retrograde orbits regress instead of precess.

Input [a km, e, i deg, days]. With mu=398600.4418, Re=6378.137, J2=1.08263e-3, n=sqrt(mu/a^3), p=a(1-e^2): dRAAN/dt=-1.5 n J2 (Re/p)^2 cos i, dargp/dt=0.75 n J2 (Re/p)^2 (5cos^2 i-1). Return [RAAN drift deg, argp drift deg over the interval (rounded 4), sun-synchronous flag: |RAAN rate in deg/day - 0.9856|<0.01].

split: open-access


prompt:
Critical inclination still shows perigee drift of the wrong direction.

Input [a km, e, i deg, days]. With mu=398600.4418, Re=6378.137, J2=1.08263e-3, n=sqrt(mu/a^3), p=a(1-e^2): dRAAN/dt=-1.5 n J2 (Re/p)^2 cos i, dargp/dt=0.75 n J2 (Re/p)^2 (5cos^2 i-1). Return [RAAN drift deg, argp drift deg over the interval (rounded 4), sun-synchronous flag: |RAAN rate in deg/day - 0.9856|<0.01].

split: open-access


prompt:
Accumulated drift is 24 times too small.

Input [a km, e, i deg, days]. With mu=398600.4418, Re=6378.137, J2=1.08263e-3, n=sqrt(mu/a^3), p=a(1-e^2): dRAAN/dt=-1.5 n J2 (Re/p)^2 cos i, dargp/dt=0.75 n J2 (Re/p)^2 (5cos^2 i-1). Return [RAAN drift deg, argp drift deg over the interval (rounded 4), sun-synchronous flag: |RAAN rate in deg/day - 0.9856|<0.01].

split: open-access


prompt:
Prograde orbits that regress at 0.9856 deg/day are flagged sun-synchronous.

Input [a km, e, i deg, days]. With mu=398600.4418, Re=6378.137, J2=1.08263e-3, n=sqrt(mu/a^3), p=a(1-e^2): dRAAN/dt=-1.5 n J2 (Re/p)^2 cos i, dargp/dt=0.75 n J2 (Re/p)^2 (5cos^2 i-1). Return [RAAN drift deg, argp drift deg over the interval (rounded 4), sun-synchronous flag: |RAAN rate in deg/day - 0.9856|<0.01].

split: open-access


prompt:
Outbound hyperbolic arcs are reported as inbound.

Input [M, e] with e>1 (else None). Solve e sinh H - H = M by Newton from H=asinh(M/e) (60 iterations max, stop when step<1e-13). Return [H, nu, nu_inf] rounded to 9 with nu=2 atan(sqrt((e+1)/(e-1)) tanh(H/2)) and asymptote nu_inf=acos(-1/e).

split: open-access


prompt:
True anomaly can exceed the asymptote.

Input [M, e] with e>1 (else None). Solve e sinh H - H = M by Newton from H=asinh(M/e) (60 iterations max, stop when step<1e-13). Return [H, nu, nu_inf] rounded to 9 with nu=2 atan(sqrt((e+1)/(e-1)) tanh(H/2)) and asymptote nu_inf=acos(-1/e).

split: open-access


prompt:
True anomalies are compressed toward periapsis.

Input [M, e] with e>1 (else None). Solve e sinh H - H = M by Newton from H=asinh(M/e) (60 iterations max, stop when step<1e-13). Return [H, nu, nu_inf] rounded to 9 with nu=2 atan(sqrt((e+1)/(e-1)) tanh(H/2)) and asymptote nu_inf=acos(-1/e).

split: open-access


prompt:
The reported departure asymptote lies on the wrong side of the latus rectum.

Input [M, e] with e>1 (else None). Solve e sinh H - H = M by Newton from H=asinh(M/e) (60 iterations max, stop when step<1e-13). Return [H, nu, nu_inf] rounded to 9 with nu=2 atan(sqrt((e+1)/(e-1)) tanh(H/2)) and asymptote nu_inf=acos(-1/e).

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
    z=x
    if z>1e-6:
        s=math.sqrt(z)
        c=(1-math.cos(s))/z; S=(s-math.sin(s))/s**3
    elif z<-1e-6:
        s=math.sqrt(-z)
        c=(1-math.cosh(s))/(-z); S=(math.sinh(s)-s)/s**3
    else:
        c=1/2-z/24+z*z/720; S=1/6-z/120+z*z/5040
    return [round(c,10),round(S,10)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('stumpff functions for universal variables -0.5', -0.5, [0.521183673, 0.1708832825]), ('stumpff functions for universal variables 4.0', 4.0, [0.3540367091, 0.1363378216]), ('stumpff functions for universal variables 0.5', 0.5, [0.4795108058, 0.1625492603]), ('stumpff functions for universal variables 30.0', 30.0, [0.0102526963, 0.0377242152]), ('stumpff functions for universal variables 1e-07', 1e-07, [0.4999999958, 0.1666666658]), ('stumpff functions for universal variables 0.0', 0.0, [0.5, 0.1666666667]), ('stumpff functions for universal variables -1e-07', -1e-07, [0.5000000042, 0.1666666675])], [('stumpff functions for universal variables -4.0', -4.0, [0.6905489228, 0.203357551]), ('stumpff functions for universal variables 1e-07', 1e-07, [0.4999999958, 0.1666666658]), ('stumpff functions for universal variables 0.0', 0.0, [0.5, 0.1666666667]), ('stumpff functions for universal variables -1e-07', -1e-07, [0.5000000042, 0.1666666675]), ('stumpff functions for universal variables -0.5', -0.5, [0.521183673, 0.1708832825]), ('stumpff functions for universal variables -25.0', -25.0, [2.928397941, 0.5536256846]), ('stumpff functions for universal variables 9.8696', 9.8696, [0.2026424576, 0.1013212062])], [('stumpff functions for universal variables -25.0', -25.0, [2.928397941, 0.5536256846]), ('stumpff functions for universal variables -0.5', -0.5, [0.521183673, 0.1708832825]), ('stumpff functions for universal variables -4.0', -4.0, [0.6905489228, 0.203357551]), ('stumpff functions for universal variables 9.8696', 9.8696, [0.2026424576, 0.1013212062]), ('stumpff functions for universal variables 0.05', 0.05, [0.4979201358, 0.1662504957]), ('stumpff functions for universal variables -0.05', -0.05, [0.5020868087, 0.1670838297]), ('stumpff functions for universal variables 2e-06', 2e-06, [0.4999999167, 0.16666665])], [('stumpff functions for universal variables -0.05', -0.05, [0.5020868087, 0.1670838297]), ('stumpff functions for universal variables 9.8696', 9.8696, [0.2026424576, 0.1013212062]), ('stumpff functions for universal variables 0.05', 0.05, [0.4979201358, 0.1662504957]), ('stumpff functions for universal variables 2e-06', 2e-06, [0.4999999167, 0.16666665]), ('stumpff functions for universal variables -3e-06', -3e-06, [0.500000125, 0.1666666917]), ('stumpff functions for universal variables 4.0', 4.0, [0.3540367091, 0.1363378216]), ('stumpff functions for universal variables 0.5', 0.5, [0.4795108058, 0.1625492603])], [('stumpff functions for universal variables -3e-06', -3e-06, [0.500000125, 0.1666666917]), ('stumpff functions for universal variables 2e-06', 2e-06, [0.4999999167, 0.16666665]), ('stumpff functions for universal variables 4.0', 4.0, [0.3540367091, 0.1363378216]), ('stumpff functions for universal variables 0.5', 0.5, [0.4795108058, 0.1625492603]), ('stumpff functions for universal variables 30.0', 30.0, [0.0102526963, 0.0377242152]), ('stumpff functions for universal variables 1e-07', 1e-07, [0.4999999958, 0.1666666658]), ('stumpff functions for universal variables 0.0', 0.0, [0.5, 0.1666666667])]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
    z=x
    if z>1e-6:
        s=math.sqrt(z)
        c=(1-math.cos(s))/z; S=(s-math.sin(s))/s**3
    elif z<-1e-6:
        s=math.sqrt(-z)
        c=(math.cosh(s)-1)/z; S=(math.sinh(s)-s)/s**3
    else:
        c=1/2-z/24+z*z/720; S=1/6-z/120+z*z/5040
    return [round(c,10),round(S,10)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('stumpff functions for universal variables -0.5', -0.5, [0.521183673, 0.1708832825]), ('stumpff functions for universal variables 4.0', 4.0, [0.3540367091, 0.1363378216]), ('stumpff functions for universal variables 0.5', 0.5, [0.4795108058, 0.1625492603]), ('stumpff functions for universal variables 30.0', 30.0, [0.0102526963, 0.0377242152]), ('stumpff functions for universal variables 1e-07', 1e-07, [0.4999999958, 0.1666666658]), ('stumpff functions for universal variables 0.0', 0.0, [0.5, 0.1666666667]), ('stumpff functions for universal variables -1e-07', -1e-07, [0.5000000042, 0.1666666675])], [('stumpff functions for universal variables -4.0', -4.0, [0.6905489228, 0.203357551]), ('stumpff functions for universal variables 1e-07', 1e-07, [0.4999999958, 0.1666666658]), ('stumpff functions for universal variables 0.0', 0.0, [0.5, 0.1666666667]), ('stumpff functions for universal variables -1e-07', -1e-07, [0.5000000042, 0.1666666675]), ('stumpff functions for universal variables -0.5', -0.5, [0.521183673, 0.1708832825]), ('stumpff functions for universal variables -25.0', -25.0, [2.928397941, 0.5536256846]), ('stumpff functions for universal variables 9.8696', 9.8696, [0.2026424576, 0.1013212062])], [('stumpff functions for universal variables -25.0', -25.0, [2.928397941, 0.5536256846]), ('stumpff functions for universal variables -0.5', -0.5, [0.521183673, 0.1708832825]), ('stumpff functions for universal variables -4.0', -4.0, [0.6905489228, 0.203357551]), ('stumpff functions for universal variables 9.8696', 9.8696, [0.2026424576, 0.1013212062]), ('stumpff functions for universal variables 0.05', 0.05, [0.4979201358, 0.1662504957]), ('stumpff functions for universal variables -0.05', -0.05, [0.5020868087, 0.1670838297]), ('stumpff functions for universal variables 2e-06', 2e-06, [0.4999999167, 0.16666665])], [('stumpff functions for universal variables -0.05', -0.05, [0.5020868087, 0.1670838297]), ('stumpff functions for universal variables 9.8696', 9.8696, [0.2026424576, 0.1013212062]), ('stumpff functions for universal variables 0.05', 0.05, [0.4979201358, 0.1662504957]), ('stumpff functions for universal variables 2e-06', 2e-06, [0.4999999167, 0.16666665]), ('stumpff functions for universal variables -3e-06', -3e-06, [0.500000125, 0.1666666917]), ('stumpff functions for universal variables 4.0', 4.0, [0.3540367091, 0.1363378216]), ('stumpff functions for universal variables 0.5', 0.5, [0.4795108058, 0.1625492603])], [('stumpff functions for universal variables -3e-06', -3e-06, [0.500000125, 0.1666666917]), ('stumpff functions for universal variables 2e-06', 2e-06, [0.4999999167, 0.16666665]), ('stumpff functions for universal variables 4.0', 4.0, [0.3540367091, 0.1363378216]), ('stumpff functions for universal variables 0.5', 0.5, [0.4795108058, 0.1625492603]), ('stumpff functions for universal variables 30.0', 30.0, [0.0102526963, 0.0377242152]), ('stumpff functions for universal variables 1e-07', 1e-07, [0.4999999958, 0.1666666658]), ('stumpff functions for universal variables 0.0', 0.0, [0.5, 0.1666666667])]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Universal-variable propagation diverges on hyperbolic arcs.

Input z. For z>1e-6: C=(1-cos s)/z, S=(s-sin s)/s^3 with s=sqrt z; for z<-1e-6: C=(cosh s-1)/(-z), S=(sinh s-s)/s^3 with s=sqrt(-z); otherwise series C=1/2-z/24+z^2/720, S=1/6-z/120+z^2/5040. Return [C,S] rounded to 10.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
    z=x
    if z>1e-6:
        s=math.sqrt(z)
        c=(1-math.cos(s))/z; S=(s-math.sin(s))/s**3
    elif z<-1e-6:
        s=math.sqrt(-z)
        c=(math.cosh(s)-1)/(-z); S=(s-math.sinh(s))/s**3
    else:
        c=1/2-z/24+z*z/720; S=1/6-z/120+z*z/5040
    return [round(c,10),round(S,10)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('stumpff functions for universal variables -0.5', -0.5, [0.521183673, 0.1708832825]), ('stumpff functions for universal variables 4.0', 4.0, [0.3540367091, 0.1363378216]), ('stumpff functions for universal variables 0.5', 0.5, [0.4795108058, 0.1625492603]), ('stumpff functions for universal variables 30.0', 30.0, [0.0102526963, 0.0377242152]), ('stumpff functions for universal variables 1e-07', 1e-07, [0.4999999958, 0.1666666658]), ('stumpff functions for universal variables 0.0', 0.0, [0.5, 0.1666666667]), ('stumpff functions for universal variables -1e-07', -1e-07, [0.5000000042, 0.1666666675])], [('stumpff functions for universal variables -4.0', -4.0, [0.6905489228, 0.203357551]), ('stumpff functions for universal variables 1e-07', 1e-07, [0.4999999958, 0.1666666658]), ('stumpff functions for universal variables 0.0', 0.0, [0.5, 0.1666666667]), ('stumpff functions for universal variables -1e-07', -1e-07, [0.5000000042, 0.1666666675]), ('stumpff functions for universal variables -0.5', -0.5, [0.521183673, 0.1708832825]), ('stumpff functions for universal variables -25.0', -25.0, [2.928397941, 0.5536256846]), ('stumpff functions for universal variables 9.8696', 9.8696, [0.2026424576, 0.1013212062])], [('stumpff functions for universal variables -25.0', -25.0, [2.928397941, 0.5536256846]), ('stumpff functions for universal variables -0.5', -0.5, [0.521183673, 0.1708832825]), ('stumpff functions for universal variables -4.0', -4.0, [0.6905489228, 0.203357551]), ('stumpff functions for universal variables 9.8696', 9.8696, [0.2026424576, 0.1013212062]), ('stumpff functions for universal variables 0.05', 0.05, [0.4979201358, 0.1662504957]), ('stumpff functions for universal variables -0.05', -0.05, [0.5020868087, 0.1670838297]), ('stumpff functions for universal variables 2e-06', 2e-06, [0.4999999167, 0.16666665])], [('stumpff functions for universal variables -0.05', -0.05, [0.5020868087, 0.1670838297]), ('stumpff functions for universal variables 9.8696', 9.8696, [0.2026424576, 0.1013212062]), ('stumpff functions for universal variables 0.05', 0.05, [0.4979201358, 0.1662504957]), ('stumpff functions for universal variables 2e-06', 2e-06, [0.4999999167, 0.16666665]), ('stumpff functions for universal variables -3e-06', -3e-06, [0.500000125, 0.1666666917]), ('stumpff functions for universal variables 4.0', 4.0, [0.3540367091, 0.1363378216]), ('stumpff functions for universal variables 0.5', 0.5, [0.4795108058, 0.1625492603])], [('stumpff functions for universal variables -3e-06', -3e-06, [0.500000125, 0.1666666917]), ('stumpff functions for universal variables 2e-06', 2e-06, [0.4999999167, 0.16666665]), ('stumpff functions for universal variables 4.0', 4.0, [0.3540367091, 0.1363378216]), ('stumpff functions for universal variables 0.5', 0.5, [0.4795108058, 0.1625492603]), ('stumpff functions for universal variables 30.0', 30.0, [0.0102526963, 0.0377242152]), ('stumpff functions for universal variables 1e-07', 1e-07, [0.4999999958, 0.1666666658]), ('stumpff functions for universal variables 0.0', 0.0, [0.5, 0.1666666667])]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
    z=x
    if z>1e-6:
        s=math.sqrt(z)
        c=(1-math.cos(s))/z; S=(s-math.sin(s))/s**3
    elif z<-1e-6:
        s=math.sqrt(-z)
        c=(math.cosh(s)-1)/(-z); S=(math.sinh(s)-s)/s**2
    else:
        c=1/2-z/24+z*z/720; S=1/6-z/120+z*z/5040
    return [round(c,10),round(S,10)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('stumpff functions for universal variables -0.5', -0.5, [0.521183673, 0.1708832825]), ('stumpff functions for universal variables 4.0', 4.0, [0.3540367091, 0.1363378216]), ('stumpff functions for universal variables 0.5', 0.5, [0.4795108058, 0.1625492603]), ('stumpff functions for universal variables 30.0', 30.0, [0.0102526963, 0.0377242152]), ('stumpff functions for universal variables 1e-07', 1e-07, [0.4999999958, 0.1666666658]), ('stumpff functions for universal variables 0.0', 0.0, [0.5, 0.1666666667]), ('stumpff functions for universal variables -1e-07', -1e-07, [0.5000000042, 0.1666666675])], [('stumpff functions for universal variables -4.0', -4.0, [0.6905489228, 0.203357551]), ('stumpff functions for universal variables 1e-07', 1e-07, [0.4999999958, 0.1666666658]), ('stumpff functions for universal variables 0.0', 0.0, [0.5, 0.1666666667]), ('stumpff functions for universal variables -1e-07', -1e-07, [0.5000000042, 0.1666666675]), ('stumpff functions for universal variables -0.5', -0.5, [0.521183673, 0.1708832825]), ('stumpff functions for universal variables -25.0', -25.0, [2.928397941, 0.5536256846]), ('stumpff functions for universal variables 9.8696', 9.8696, [0.2026424576, 0.1013212062])], [('stumpff functions for universal variables -25.0', -25.0, [2.928397941, 0.5536256846]), ('stumpff functions for universal variables -0.5', -0.5, [0.521183673, 0.1708832825]), ('stumpff functions for universal variables -4.0', -4.0, [0.6905489228, 0.203357551]), ('stumpff functions for universal variables 9.8696', 9.8696, [0.2026424576, 0.1013212062]), ('stumpff functions for universal variables 0.05', 0.05, [0.4979201358, 0.1662504957]), ('stumpff functions for universal variables -0.05', -0.05, [0.5020868087, 0.1670838297]), ('stumpff functions for universal variables 2e-06', 2e-06, [0.4999999167, 0.16666665])], [('stumpff functions for universal variables -0.05', -0.05, [0.5020868087, 0.1670838297]), ('stumpff functions for universal variables 9.8696', 9.8696, [0.2026424576, 0.1013212062]), ('stumpff functions for universal variables 0.05', 0.05, [0.4979201358, 0.1662504957]), ('stumpff functions for universal variables 2e-06', 2e-06, [0.4999999167, 0.16666665]), ('stumpff functions for universal variables -3e-06', -3e-06, [0.500000125, 0.1666666917]), ('stumpff functions for universal variables 4.0', 4.0, [0.3540367091, 0.1363378216]), ('stumpff functions for universal variables 0.5', 0.5, [0.4795108058, 0.1625492603])], [('stumpff functions for universal variables -3e-06', -3e-06, [0.500000125, 0.1666666917]), ('stumpff functions for universal variables 2e-06', 2e-06, [0.4999999167, 0.16666665]), ('stumpff functions for universal variables 4.0', 4.0, [0.3540367091, 0.1363378216]), ('stumpff functions for universal variables 0.5', 0.5, [0.4795108058, 0.1625492603]), ('stumpff functions for universal variables 30.0', 30.0, [0.0102526963, 0.0377242152]), ('stumpff functions for universal variables 1e-07', 1e-07, [0.4999999958, 0.1666666658]), ('stumpff functions for universal variables 0.0', 0.0, [0.5, 0.1666666667])]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Time of flight on hyperbolic arcs is negative.

Input z. For z>1e-6: C=(1-cos s)/z, S=(s-sin s)/s^3 with s=sqrt z; for z<-1e-6: C=(cosh s-1)/(-z), S=(sinh s-s)/s^3 with s=sqrt(-z); otherwise series C=1/2-z/24+z^2/720, S=1/6-z/120+z^2/5040. Return [C,S] rounded to 10.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
    z=x
    if z>1e-6:
        s=math.sqrt(z)
        c=(1-math.cos(s))/z; S=(s-math.sin(s))/s**2
    elif z<-1e-6:
        s=math.sqrt(-z)
        c=(math.cosh(s)-1)/(-z); S=(math.sinh(s)-s)/s**3
    else:
        c=1/2-z/24+z*z/720; S=1/6-z/120+z*z/5040
    return [round(c,10),round(S,10)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('stumpff functions for universal variables 4.0', 4.0, [0.3540367091, 0.1363378216]), ('stumpff functions for universal variables 0.5', 0.5, [0.4795108058, 0.1625492603]), ('stumpff functions for universal variables 30.0', 30.0, [0.0102526963, 0.0377242152]), ('stumpff functions for universal variables 1e-07', 1e-07, [0.4999999958, 0.1666666658]), ('stumpff functions for universal variables 0.0', 0.0, [0.5, 0.1666666667]), ('stumpff functions for universal variables -1e-07', -1e-07, [0.5000000042, 0.1666666675]), ('stumpff functions for universal variables -0.5', -0.5, [0.521183673, 0.1708832825])], [('stumpff functions for universal variables 0.5', 0.5, [0.4795108058, 0.1625492603]), ('stumpff functions for universal variables 1e-07', 1e-07, [0.4999999958, 0.1666666658]), ('stumpff functions for universal variables 0.0', 0.0, [0.5, 0.1666666667]), ('stumpff functions for universal variables -1e-07', -1e-07, [0.5000000042, 0.1666666675]), ('stumpff functions for universal variables -0.5', -0.5, [0.521183673, 0.1708832825]), ('stumpff functions for universal variables -4.0', -4.0, [0.6905489228, 0.203357551]), ('stumpff functions for universal variables -25.0', -25.0, [2.928397941, 0.5536256846])], [('stumpff functions for universal variables 30.0', 30.0, [0.0102526963, 0.0377242152]), ('stumpff functions for universal variables -0.5', -0.5, [0.521183673, 0.1708832825]), ('stumpff functions for universal variables -4.0', -4.0, [0.6905489228, 0.203357551]), ('stumpff functions for universal variables -25.0', -25.0, [2.928397941, 0.5536256846]), ('stumpff functions for universal variables 9.8696', 9.8696, [0.2026424576, 0.1013212062]), ('stumpff functions for universal variables 0.05', 0.05, [0.4979201358, 0.1662504957]), ('stumpff functions for universal variables -0.05', -0.05, [0.5020868087, 0.1670838297])], [('stumpff functions for universal variables 9.8696', 9.8696, [0.2026424576, 0.1013212062]), ('stumpff functions for universal variables 0.05', 0.05, [0.4979201358, 0.1662504957]), ('stumpff functions for universal variables -0.05', -0.05, [0.5020868087, 0.1670838297]), ('stumpff functions for universal variables 2e-06', 2e-06, [0.4999999167, 0.16666665]), ('stumpff functions for universal variables -3e-06', -3e-06, [0.500000125, 0.1666666917]), ('stumpff functions for universal variables 4.0', 4.0, [0.3540367091, 0.1363378216]), ('stumpff functions for universal variables 0.5', 0.5, [0.4795108058, 0.1625492603])], [('stumpff functions for universal variables 0.05', 0.05, [0.4979201358, 0.1662504957]), ('stumpff functions for universal variables 2e-06', 2e-06, [0.4999999167, 0.16666665]), ('stumpff functions for universal variables -3e-06', -3e-06, [0.500000125, 0.1666666917]), ('stumpff functions for universal variables 4.0', 4.0, [0.3540367091, 0.1363378216]), ('stumpff functions for universal variables 0.5', 0.5, [0.4795108058, 0.1625492603]), ('stumpff functions for universal variables 30.0', 30.0, [0.0102526963, 0.0377242152]), ('stumpff functions for universal variables 1e-07', 1e-07, [0.4999999958, 0.1666666658])]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
    z=x
    if z>1e-6:
        s=math.sqrt(z)
        c=(1-math.cos(s))/z; S=(s-math.sin(s))/z**2
    elif z<-1e-6:
        s=math.sqrt(-z)
        c=(math.cosh(s)-1)/(-z); S=(math.sinh(s)-s)/s**3
    else:
        c=1/2-z/24+z*z/720; S=1/6-z/120+z*z/5040
    return [round(c,10),round(S,10)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('stumpff functions for universal variables 4.0', 4.0, [0.3540367091, 0.1363378216]), ('stumpff functions for universal variables 0.5', 0.5, [0.4795108058, 0.1625492603]), ('stumpff functions for universal variables 30.0', 30.0, [0.0102526963, 0.0377242152]), ('stumpff functions for universal variables 1e-07', 1e-07, [0.4999999958, 0.1666666658]), ('stumpff functions for universal variables 0.0', 0.0, [0.5, 0.1666666667]), ('stumpff functions for universal variables -1e-07', -1e-07, [0.5000000042, 0.1666666675]), ('stumpff functions for universal variables -0.5', -0.5, [0.521183673, 0.1708832825])], [('stumpff functions for universal variables 0.5', 0.5, [0.4795108058, 0.1625492603]), ('stumpff functions for universal variables 1e-07', 1e-07, [0.4999999958, 0.1666666658]), ('stumpff functions for universal variables 0.0', 0.0, [0.5, 0.1666666667]), ('stumpff functions for universal variables -1e-07', -1e-07, [0.5000000042, 0.1666666675]), ('stumpff functions for universal variables -0.5', -0.5, [0.521183673, 0.1708832825]), ('stumpff functions for universal variables -4.0', -4.0, [0.6905489228, 0.203357551]), ('stumpff functions for universal variables -25.0', -25.0, [2.928397941, 0.5536256846])], [('stumpff functions for universal variables 30.0', 30.0, [0.0102526963, 0.0377242152]), ('stumpff functions for universal variables -0.5', -0.5, [0.521183673, 0.1708832825]), ('stumpff functions for universal variables -4.0', -4.0, [0.6905489228, 0.203357551]), ('stumpff functions for universal variables -25.0', -25.0, [2.928397941, 0.5536256846]), ('stumpff functions for universal variables 9.8696', 9.8696, [0.2026424576, 0.1013212062]), ('stumpff functions for universal variables 0.05', 0.05, [0.4979201358, 0.1662504957]), ('stumpff functions for universal variables -0.05', -0.05, [0.5020868087, 0.1670838297])], [('stumpff functions for universal variables 9.8696', 9.8696, [0.2026424576, 0.1013212062]), ('stumpff functions for universal variables 0.05', 0.05, [0.4979201358, 0.1662504957]), ('stumpff functions for universal variables -0.05', -0.05, [0.5020868087, 0.1670838297]), ('stumpff functions for universal variables 2e-06', 2e-06, [0.4999999167, 0.16666665]), ('stumpff functions for universal variables -3e-06', -3e-06, [0.500000125, 0.1666666917]), ('stumpff functions for universal variables 4.0', 4.0, [0.3540367091, 0.1363378216]), ('stumpff functions for universal variables 0.5', 0.5, [0.4795108058, 0.1625492603])], [('stumpff functions for universal variables 0.05', 0.05, [0.4979201358, 0.1662504957]), ('stumpff functions for universal variables 2e-06', 2e-06, [0.4999999167, 0.16666665]), ('stumpff functions for universal variables -3e-06', -3e-06, [0.500000125, 0.1666666917]), ('stumpff functions for universal variables 4.0', 4.0, [0.3540367091, 0.1363378216]), ('stumpff functions for universal variables 0.5', 0.5, [0.4795108058, 0.1625492603]), ('stumpff functions for universal variables 30.0', 30.0, [0.0102526963, 0.0377242152]), ('stumpff functions for universal variables 1e-07', 1e-07, [0.4999999958, 0.1666666658])]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Elliptic time of flight is scaled by sqrt(z).

Input z. For z>1e-6: C=(1-cos s)/z, S=(s-sin s)/s^3 with s=sqrt z; for z<-1e-6: C=(cosh s-1)/(-z), S=(sinh s-s)/s^3 with s=sqrt(-z); otherwise series C=1/2-z/24+z^2/720, S=1/6-z/120+z^2/5040. Return [C,S] rounded to 10.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
    z=x
    if z>1e-6:
        s=math.sqrt(z)
        c=(1-math.cos(s))/z; S=(s-math.sin(s))/s**3
    elif z<-1e-6:
        s=math.sqrt(-z)
        c=(math.cosh(s)-1)/(-z); S=(math.sinh(s)-s)/s**3
    else:
        c=1/2+z/24+z*z/720; S=1/6-z/120+z*z/5040
    return [round(c,10),round(S,10)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('stumpff functions for universal variables 1e-07', 1e-07, [0.4999999958, 0.1666666658]), ('stumpff functions for universal variables 4.0', 4.0, [0.3540367091, 0.1363378216]), ('stumpff functions for universal variables 0.5', 0.5, [0.4795108058, 0.1625492603]), ('stumpff functions for universal variables 30.0', 30.0, [0.0102526963, 0.0377242152]), ('stumpff functions for universal variables 0.0', 0.0, [0.5, 0.1666666667]), ('stumpff functions for universal variables -1e-07', -1e-07, [0.5000000042, 0.1666666675]), ('stumpff functions for universal variables -0.5', -0.5, [0.521183673, 0.1708832825])], [('stumpff functions for universal variables -1e-07', -1e-07, [0.5000000042, 0.1666666675]), ('stumpff functions for universal variables 1e-07', 1e-07, [0.4999999958, 0.1666666658]), ('stumpff functions for universal variables 0.0', 0.0, [0.5, 0.1666666667]), ('stumpff functions for universal variables -0.5', -0.5, [0.521183673, 0.1708832825]), ('stumpff functions for universal variables -4.0', -4.0, [0.6905489228, 0.203357551]), ('stumpff functions for universal variables -25.0', -25.0, [2.928397941, 0.5536256846]), ('stumpff functions for universal variables 9.8696', 9.8696, [0.2026424576, 0.1013212062])], [('stumpff functions for universal variables 1e-07', 1e-07, [0.4999999958, 0.1666666658]), ('stumpff functions for universal variables -0.5', -0.5, [0.521183673, 0.1708832825]), ('stumpff functions for universal variables -4.0', -4.0, [0.6905489228, 0.203357551]), ('stumpff functions for universal variables -25.0', -25.0, [2.928397941, 0.5536256846]), ('stumpff functions for universal variables 9.8696', 9.8696, [0.2026424576, 0.1013212062]), ('stumpff functions for universal variables 0.05', 0.05, [0.4979201358, 0.1662504957]), ('stumpff functions for universal variables -0.05', -0.05, [0.5020868087, 0.1670838297])], [('stumpff functions for universal variables -1e-07', -1e-07, [0.5000000042, 0.1666666675]), ('stumpff functions for universal variables 9.8696', 9.8696, [0.2026424576, 0.1013212062]), ('stumpff functions for universal variables 0.05', 0.05, [0.4979201358, 0.1662504957]), ('stumpff functions for universal variables -0.05', -0.05, [0.5020868087, 0.1670838297]), ('stumpff functions for universal variables 2e-06', 2e-06, [0.4999999167, 0.16666665]), ('stumpff functions for universal variables -3e-06', -3e-06, [0.500000125, 0.1666666917]), ('stumpff functions for universal variables 4.0', 4.0, [0.3540367091, 0.1363378216])], [('stumpff functions for universal variables 1e-07', 1e-07, [0.4999999958, 0.1666666658]), ('stumpff functions for universal variables 2e-06', 2e-06, [0.4999999167, 0.16666665]), ('stumpff functions for universal variables -3e-06', -3e-06, [0.500000125, 0.1666666917]), ('stumpff functions for universal variables 4.0', 4.0, [0.3540367091, 0.1363378216]), ('stumpff functions for universal variables 0.5', 0.5, [0.4795108058, 0.1625492603]), ('stumpff functions for universal variables 30.0', 30.0, [0.0102526963, 0.0377242152]), ('stumpff functions for universal variables 0.0', 0.0, [0.5, 0.1666666667])]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
    z=x
    if z>1e-6:
        s=math.sqrt(z)
        c=(1-math.cos(s))/z; S=(s-math.sin(s))/s**3
    elif z<-1e-6:
        s=math.sqrt(-z)
        c=(math.cosh(s)-1)/(-z); S=(math.sinh(s)-s)/s**3
    else:
        c=1/2-z/12+z*z/720; S=1/6-z/120+z*z/5040
    return [round(c,10),round(S,10)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('stumpff functions for universal variables 1e-07', 1e-07, [0.4999999958, 0.1666666658]), ('stumpff functions for universal variables 4.0', 4.0, [0.3540367091, 0.1363378216]), ('stumpff functions for universal variables 0.5', 0.5, [0.4795108058, 0.1625492603]), ('stumpff functions for universal variables 30.0', 30.0, [0.0102526963, 0.0377242152]), ('stumpff functions for universal variables 0.0', 0.0, [0.5, 0.1666666667]), ('stumpff functions for universal variables -1e-07', -1e-07, [0.5000000042, 0.1666666675]), ('stumpff functions for universal variables -0.5', -0.5, [0.521183673, 0.1708832825])], [('stumpff functions for universal variables -1e-07', -1e-07, [0.5000000042, 0.1666666675]), ('stumpff functions for universal variables 1e-07', 1e-07, [0.4999999958, 0.1666666658]), ('stumpff functions for universal variables 0.0', 0.0, [0.5, 0.1666666667]), ('stumpff functions for universal variables -0.5', -0.5, [0.521183673, 0.1708832825]), ('stumpff functions for universal variables -4.0', -4.0, [0.6905489228, 0.203357551]), ('stumpff functions for universal variables -25.0', -25.0, [2.928397941, 0.5536256846]), ('stumpff functions for universal variables 9.8696', 9.8696, [0.2026424576, 0.1013212062])], [('stumpff functions for universal variables 1e-07', 1e-07, [0.4999999958, 0.1666666658]), ('stumpff functions for universal variables -0.5', -0.5, [0.521183673, 0.1708832825]), ('stumpff functions for universal variables -4.0', -4.0, [0.6905489228, 0.203357551]), ('stumpff functions for universal variables -25.0', -25.0, [2.928397941, 0.5536256846]), ('stumpff functions for universal variables 9.8696', 9.8696, [0.2026424576, 0.1013212062]), ('stumpff functions for universal variables 0.05', 0.05, [0.4979201358, 0.1662504957]), ('stumpff functions for universal variables -0.05', -0.05, [0.5020868087, 0.1670838297])], [('stumpff functions for universal variables -1e-07', -1e-07, [0.5000000042, 0.1666666675]), ('stumpff functions for universal variables 9.8696', 9.8696, [0.2026424576, 0.1013212062]), ('stumpff functions for universal variables 0.05', 0.05, [0.4979201358, 0.1662504957]), ('stumpff functions for universal variables -0.05', -0.05, [0.5020868087, 0.1670838297]), ('stumpff functions for universal variables 2e-06', 2e-06, [0.4999999167, 0.16666665]), ('stumpff functions for universal variables -3e-06', -3e-06, [0.500000125, 0.1666666917]), ('stumpff functions for universal variables 4.0', 4.0, [0.3540367091, 0.1363378216])], [('stumpff functions for universal variables 1e-07', 1e-07, [0.4999999958, 0.1666666658]), ('stumpff functions for universal variables 2e-06', 2e-06, [0.4999999167, 0.16666665]), ('stumpff functions for universal variables -3e-06', -3e-06, [0.500000125, 0.1666666917]), ('stumpff functions for universal variables 4.0', 4.0, [0.3540367091, 0.1363378216]), ('stumpff functions for universal variables 0.5', 0.5, [0.4795108058, 0.1625492603]), ('stumpff functions for universal variables 30.0', 30.0, [0.0102526963, 0.0377242152]), ('stumpff functions for universal variables 0.0', 0.0, [0.5, 0.1666666667])]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Near-parabolic orbits get a slightly wrong C.

Input z. For z>1e-6: C=(1-cos s)/z, S=(s-sin s)/s^3 with s=sqrt z; for z<-1e-6: C=(cosh s-1)/(-z), S=(sinh s-s)/s^3 with s=sqrt(-z); otherwise series C=1/2-z/24+z^2/720, S=1/6-z/120+z^2/5040. Return [C,S] rounded to 10.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
    z=x
    if z>1.0:
        s=math.sqrt(z)
        c=(1-math.cos(s))/z; S=(s-math.sin(s))/s**3
    elif z<-1.0:
        s=math.sqrt(-z)
        c=(math.cosh(s)-1)/(-z); S=(math.sinh(s)-s)/s**3
    else:
        c=1/2-z/24+z*z/720; S=1/6-z/120+z*z/5040
    return [round(c,10),round(S,10)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('stumpff functions for universal variables 0.5', 0.5, [0.4795108058, 0.1625492603]), ('stumpff functions for universal variables 0.05', 0.05, [0.4979201358, 0.1662504957]), ('stumpff functions for universal variables 4.0', 4.0, [0.3540367091, 0.1363378216]), ('stumpff functions for universal variables 30.0', 30.0, [0.0102526963, 0.0377242152]), ('stumpff functions for universal variables 1e-07', 1e-07, [0.4999999958, 0.1666666658]), ('stumpff functions for universal variables 0.0', 0.0, [0.5, 0.1666666667]), ('stumpff functions for universal variables -1e-07', -1e-07, [0.5000000042, 0.1666666675])], [('stumpff functions for universal variables -0.5', -0.5, [0.521183673, 0.1708832825]), ('stumpff functions for universal variables -0.05', -0.05, [0.5020868087, 0.1670838297]), ('stumpff functions for universal variables 1e-07', 1e-07, [0.4999999958, 0.1666666658]), ('stumpff functions for universal variables 0.0', 0.0, [0.5, 0.1666666667]), ('stumpff functions for universal variables -1e-07', -1e-07, [0.5000000042, 0.1666666675]), ('stumpff functions for universal variables -4.0', -4.0, [0.6905489228, 0.203357551]), ('stumpff functions for universal variables -25.0', -25.0, [2.928397941, 0.5536256846])], [('stumpff functions for universal variables 0.05', 0.05, [0.4979201358, 0.1662504957]), ('stumpff functions for universal variables -0.5', -0.5, [0.521183673, 0.1708832825]), ('stumpff functions for universal variables -4.0', -4.0, [0.6905489228, 0.203357551]), ('stumpff functions for universal variables -25.0', -25.0, [2.928397941, 0.5536256846]), ('stumpff functions for universal variables 9.8696', 9.8696, [0.2026424576, 0.1013212062]), ('stumpff functions for universal variables -0.05', -0.05, [0.5020868087, 0.1670838297]), ('stumpff functions for universal variables 2e-06', 2e-06, [0.4999999167, 0.16666665])], [('stumpff functions for universal variables -0.05', -0.05, [0.5020868087, 0.1670838297]), ('stumpff functions for universal variables 9.8696', 9.8696, [0.2026424576, 0.1013212062]), ('stumpff functions for universal variables 0.05', 0.05, [0.4979201358, 0.1662504957]), ('stumpff functions for universal variables 2e-06', 2e-06, [0.4999999167, 0.16666665]), ('stumpff functions for universal variables -3e-06', -3e-06, [0.500000125, 0.1666666917]), ('stumpff functions for universal variables 4.0', 4.0, [0.3540367091, 0.1363378216]), ('stumpff functions for universal variables 0.5', 0.5, [0.4795108058, 0.1625492603])], [('stumpff functions for universal variables 0.5', 0.5, [0.4795108058, 0.1625492603]), ('stumpff functions for universal variables 0.05', 0.05, [0.4979201358, 0.1662504957]), ('stumpff functions for universal variables 2e-06', 2e-06, [0.4999999167, 0.16666665]), ('stumpff functions for universal variables -3e-06', -3e-06, [0.500000125, 0.1666666917]), ('stumpff functions for universal variables 4.0', 4.0, [0.3540367091, 0.1363378216]), ('stumpff functions for universal variables 30.0', 30.0, [0.0102526963, 0.0377242152]), ('stumpff functions for universal variables 1e-07', 1e-07, [0.4999999958, 0.1666666658])]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
    z=x
    if z>0.1:
        s=math.sqrt(z)
        c=(1-math.cos(s))/z; S=(s-math.sin(s))/s**3
    elif z<-0.1:
        s=math.sqrt(-z)
        c=(math.cosh(s)-1)/(-z); S=(math.sinh(s)-s)/s**3
    else:
        c=1/2-z/24+z*z/720; S=1/6-z/120+z*z/5040
    return [round(c,10),round(S,10)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('stumpff functions for universal variables 0.5', 0.5, [0.4795108058, 0.1625492603]), ('stumpff functions for universal variables 0.05', 0.05, [0.4979201358, 0.1662504957]), ('stumpff functions for universal variables 4.0', 4.0, [0.3540367091, 0.1363378216]), ('stumpff functions for universal variables 30.0', 30.0, [0.0102526963, 0.0377242152]), ('stumpff functions for universal variables 1e-07', 1e-07, [0.4999999958, 0.1666666658]), ('stumpff functions for universal variables 0.0', 0.0, [0.5, 0.1666666667]), ('stumpff functions for universal variables -1e-07', -1e-07, [0.5000000042, 0.1666666675])], [('stumpff functions for universal variables -0.5', -0.5, [0.521183673, 0.1708832825]), ('stumpff functions for universal variables -0.05', -0.05, [0.5020868087, 0.1670838297]), ('stumpff functions for universal variables 1e-07', 1e-07, [0.4999999958, 0.1666666658]), ('stumpff functions for universal variables 0.0', 0.0, [0.5, 0.1666666667]), ('stumpff functions for universal variables -1e-07', -1e-07, [0.5000000042, 0.1666666675]), ('stumpff functions for universal variables -4.0', -4.0, [0.6905489228, 0.203357551]), ('stumpff functions for universal variables -25.0', -25.0, [2.928397941, 0.5536256846])], [('stumpff functions for universal variables 0.05', 0.05, [0.4979201358, 0.1662504957]), ('stumpff functions for universal variables -0.5', -0.5, [0.521183673, 0.1708832825]), ('stumpff functions for universal variables -4.0', -4.0, [0.6905489228, 0.203357551]), ('stumpff functions for universal variables -25.0', -25.0, [2.928397941, 0.5536256846]), ('stumpff functions for universal variables 9.8696', 9.8696, [0.2026424576, 0.1013212062]), ('stumpff functions for universal variables -0.05', -0.05, [0.5020868087, 0.1670838297]), ('stumpff functions for universal variables 2e-06', 2e-06, [0.4999999167, 0.16666665])], [('stumpff functions for universal variables -0.05', -0.05, [0.5020868087, 0.1670838297]), ('stumpff functions for universal variables 9.8696', 9.8696, [0.2026424576, 0.1013212062]), ('stumpff functions for universal variables 0.05', 0.05, [0.4979201358, 0.1662504957]), ('stumpff functions for universal variables 2e-06', 2e-06, [0.4999999167, 0.16666665]), ('stumpff functions for universal variables -3e-06', -3e-06, [0.500000125, 0.1666666917]), ('stumpff functions for universal variables 4.0', 4.0, [0.3540367091, 0.1363378216]), ('stumpff functions for universal variables 0.5', 0.5, [0.4795108058, 0.1625492603])], [('stumpff functions for universal variables 0.5', 0.5, [0.4795108058, 0.1625492603]), ('stumpff functions for universal variables 0.05', 0.05, [0.4979201358, 0.1662504957]), ('stumpff functions for universal variables 2e-06', 2e-06, [0.4999999167, 0.16666665]), ('stumpff functions for universal variables -3e-06', -3e-06, [0.500000125, 0.1666666917]), ('stumpff functions for universal variables 4.0', 4.0, [0.3540367091, 0.1363378216]), ('stumpff functions for universal variables 30.0', 30.0, [0.0102526963, 0.0377242152]), ('stumpff functions for universal variables 1e-07', 1e-07, [0.4999999958, 0.1666666658])]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Moderate z values lose accuracy in the truncated series.

Input z. For z>1e-6: C=(1-cos s)/z, S=(s-sin s)/s^3 with s=sqrt z; for z<-1e-6: C=(cosh s-1)/(-z), S=(sinh s-s)/s^3 with s=sqrt(-z); otherwise series C=1/2-z/24+z^2/720, S=1/6-z/120+z^2/5040. Return [C,S] rounded to 10.

split: open-access


prompt:
Transfer orbit is twice too large.

Input [r1, r2, mu] circular radii. Transfer a=(r1+r2)/2; burn 1 = |v_peri - v_circ1|, burn 2 = |v_circ2 - v_apo| using vis-viva at each end; time of flight is half the transfer period. Works inward (r2<r1) too. Return [dv1, dv2, total] rounded 6 and tof rounded 3.

split: open-access


prompt:
Arrival burns are scheduled at the departure point.

Input [r1, r2, mu] circular radii. Transfer a=(r1+r2)/2; burn 1 = |v_peri - v_circ1|, burn 2 = |v_circ2 - v_apo| using vis-viva at each end; time of flight is half the transfer period. Works inward (r2<r1) too. Return [dv1, dv2, total] rounded 6 and tof rounded 3.

split: open-access


prompt:
Inward transfers report a negative arrival burn and a reduced total.

Input [r1, r2, mu] circular radii. Transfer a=(r1+r2)/2; burn 1 = |v_peri - v_circ1|, burn 2 = |v_circ2 - v_apo| using vis-viva at each end; time of flight is half the transfer period. Works inward (r2<r1) too. Return [dv1, dv2, total] rounded 6 and tof rounded 3.

split: open-access


prompt:
Arrival burn equals the departure burn geometry.

Input [r1, r2, mu] circular radii. Transfer a=(r1+r2)/2; burn 1 = |v_peri - v_circ1|, burn 2 = |v_circ2 - v_apo| using vis-viva at each end; time of flight is half the transfer period. Works inward (r2<r1) too. Return [dv1, dv2, total] rounded 6 and tof rounded 3.

split: open-access


prompt:
Many bound orbits are classified as escaping.

Input [r, v, mu, tol]. eps=v^2/2-mu/r. Parabolic when |eps|<=tol*mu/r, else elliptic (eps<0) or hyperbolic. a=-mu/(2 eps) (None if parabolic), escape speed sqrt(2mu/r), v_inf=sqrt(2 eps) for hyperbolic else None. Return [kind, a rounded 3, vesc rounded 6, vinf rounded 6].

split: open-access


prompt:
The parabolic band depends on the unit system.

Input [r, v, mu, tol]. eps=v^2/2-mu/r. Parabolic when |eps|<=tol*mu/r, else elliptic (eps<0) or hyperbolic. a=-mu/(2 eps) (None if parabolic), escape speed sqrt(2mu/r), v_inf=sqrt(2 eps) for hyperbolic else None. Return [kind, a rounded 3, vesc rounded 6, vinf rounded 6].

split: open-access


prompt:
Hyperbolic trajectories get positive axes indistinguishable from ellipses.

Input [r, v, mu, tol]. eps=v^2/2-mu/r. Parabolic when |eps|<=tol*mu/r, else elliptic (eps<0) or hyperbolic. a=-mu/(2 eps) (None if parabolic), escape speed sqrt(2mu/r), v_inf=sqrt(2 eps) for hyperbolic else None. Return [kind, a rounded 3, vesc rounded 6, vinf rounded 6].

split: open-access


prompt:
Departure v-infinity is understated by sqrt(2).

Input [r, v, mu, tol]. eps=v^2/2-mu/r. Parabolic when |eps|<=tol*mu/r, else elliptic (eps<0) or hyperbolic. a=-mu/(2 eps) (None if parabolic), escape speed sqrt(2mu/r), v_inf=sqrt(2 eps) for hyperbolic else None. Return [kind, a rounded 3, vesc rounded 6, vinf rounded 6].

split: open-access


prompt:
Escape speed is understated by sqrt(2).

Input [r, v, mu, tol]. eps=v^2/2-mu/r. Parabolic when |eps|<=tol*mu/r, else elliptic (eps<0) or hyperbolic. a=-mu/(2 eps) (None if parabolic), escape speed sqrt(2mu/r), v_inf=sqrt(2 eps) for hyperbolic else None. Return [kind, a rounded 3, vesc rounded 6, vinf rounded 6].

split: open-access


prompt:
Satellites are shadowed on the day side when the sun is not on the x axis.

Input [r, s, R]: satellite position, sun direction (any length) and body radius. With u=s/|s| and d=r.u, the satellite is sunlit when d>=0; otherwise it is in umbra when the distance of r from the shadow axis |r-d u| is <= R. Return "umbra" or "sunlit".

split: open-access


prompt:
Shadow geometry scales with the length of the sun vector.

Input [r, s, R]: satellite position, sun direction (any length) and body radius. With u=s/|s| and d=r.u, the satellite is sunlit when d>=0; otherwise it is in umbra when the distance of r from the shadow axis |r-d u| is <= R. Return "umbra" or "sunlit".

split: open-access


prompt:
Satellites far behind Earth are shadowed even when well off the axis.

Input [r, s, R]: satellite position, sun direction (any length) and body radius. With u=s/|s| and d=r.u, the satellite is sunlit when d>=0; otherwise it is in umbra when the distance of r from the shadow axis |r-d u| is <= R. Return "umbra" or "sunlit".

split: open-access


prompt:
A satellite exactly on the shadow cylinder is reported sunlit.

Input [r, s, R]: satellite position, sun direction (any length) and body radius. With u=s/|s| and d=r.u, the satellite is sunlit when d>=0; otherwise it is in umbra when the distance of r from the shadow axis |r-d u| is <= R. Return "umbra" or "sunlit".

split: open-access


prompt:
Durations are wrong away from the apsides of eccentric orbits.

Input [a, e, nu1, nu2, mu] (degrees). Convert each true anomaly to eccentric anomaly with the half-angle atan2 form and to mean anomaly in [0,2pi); flight always proceeds forward, so dM=(M2-M1) mod 2pi. Return dM/n seconds rounded to 3 with n=sqrt(mu/a^3).

split: open-access


prompt:
Flights through periapsis report negative time.

Input [a, e, nu1, nu2, mu] (degrees). Convert each true anomaly to eccentric anomaly with the half-angle atan2 form and to mean anomaly in [0,2pi); flight always proceeds forward, so dM=(M2-M1) mod 2pi. Return dM/n seconds rounded to 3 with n=sqrt(mu/a^3).

split: open-access


prompt:
Durations near periapsis are too long.

Input [a, e, nu1, nu2, mu] (degrees). Convert each true anomaly to eccentric anomaly with the half-angle atan2 form and to mean anomaly in [0,2pi); flight always proceeds forward, so dM=(M2-M1) mod 2pi. Return dM/n seconds rounded to 3 with n=sqrt(mu/a^3).

split: open-access


prompt:
Durations scale with the wrong power of the orbit size.

Input [a, e, nu1, nu2, mu] (degrees). Convert each true anomaly to eccentric anomaly with the half-angle atan2 form and to mean anomaly in [0,2pi); flight always proceeds forward, so dM=(M2-M1) mod 2pi. Return dM/n seconds rounded to 3 with n=sqrt(mu/a^3).

split: open-access


prompt:
Upper-atmosphere densities are extrapolated from sea level.

Input [alt km, v km/s, cd, area m^2, mass kg, rows]: rows are [base km, rho0 kg/m^3, H km]; the band is the highest base <= alt (None below every base). rho=rho0 exp(-(alt-base)/H). Drag acceleration = 0.5 rho (1000 v)^2 cd area/mass (m/s^2). Return [rho, accel] formatted with 7 significant digits.

split: open-access


prompt:
Density is vanishingly small in every upper band.

Input [alt km, v km/s, cd, area m^2, mass kg, rows]: rows are [base km, rho0 kg/m^3, H km]; the band is the highest base <= alt (None below every base). rho=rho0 exp(-(alt-base)/H). Drag acceleration = 0.5 rho (1000 v)^2 cd area/mass (m/s^2). Return [rho, accel] formatted with 7 significant digits.

split: open-access


prompt:
Drag is a million times too small.

Input [alt km, v km/s, cd, area m^2, mass kg, rows]: rows are [base km, rho0 kg/m^3, H km]; the band is the highest base <= alt (None below every base). rho=rho0 exp(-(alt-base)/H). Drag acceleration = 0.5 rho (1000 v)^2 cd area/mass (m/s^2). Return [rho, accel] formatted with 7 significant digits.

split: open-access


prompt:
Dense small satellites decay fastest.

Input [alt km, v km/s, cd, area m^2, mass kg, rows]: rows are [base km, rho0 kg/m^3, H km]; the band is the highest base <= alt (None below every base). rho=rho0 exp(-(alt-base)/H). Drag acceleration = 0.5 rho (1000 v)^2 cd area/mass (m/s^2). Return [rho, accel] formatted with 7 significant digits.

split: open-access


prompt:
Out-of-range altitudes silently extrapolate.

Input [alt km, v km/s, cd, area m^2, mass kg, rows]: rows are [base km, rho0 kg/m^3, H km]; the band is the highest base <= alt (None below every base). rho=rho0 exp(-(alt-base)/H). Drag acceleration = 0.5 rho (1000 v)^2 cd area/mass (m/s^2). Return [rho, accel] formatted with 7 significant digits.

split: open-access


prompt:
A prograde burn appears to lower the chaser.

Input [x0,y0,z0,vx0,vy0,vz0,n,t] with x radial, y along-track, z cross-track about a circular reference orbit of mean motion n. Return [x,y,z,vx,vy,vz] from the closed-form HCW solution, rounded to 6.

split: open-access


prompt:
Along-track drift from a velocity offset is scaled by n.

Input [x0,y0,z0,vx0,vy0,vz0,n,t] with x radial, y along-track, z cross-track about a circular reference orbit of mean motion n. Return [x,y,z,vx,vy,vz] from the closed-form HCW solution, rounded to 6.

split: open-access


prompt:
Out-of-plane excursions are scaled by the mean motion.

Input [x0,y0,z0,vx0,vy0,vz0,n,t] with x radial, y along-track, z cross-track about a circular reference orbit of mean motion n. Return [x,y,z,vx,vy,vz] from the closed-form HCW solution, rounded to 6.

split: open-access


prompt:
A lower chaser appears to fall behind.

Input [x0,y0,z0,vx0,vy0,vz0,n,t] with x radial, y along-track, z cross-track about a circular reference orbit of mean motion n. Return [x,y,z,vx,vy,vz] from the closed-form HCW solution, rounded to 6.

split: open-access


prompt:
Radial velocity is out of phase with the radial displacement.

Input [x0,y0,z0,vx0,vy0,vz0,n,t] with x radial, y along-track, z cross-track about a circular reference orbit of mean motion n. Return [x,y,z,vx,vy,vz] from the closed-form HCW solution, rounded to 6.

split: open-access


prompt:
Deputies ahead of the chief are reported behind it.

Input [rc, vc, rd]: chief position and velocity and deputy position. R=rc/|rc|, C=(rc x vc)/|rc x vc|, I=C x R. Return the deputy offset rd-rc projected onto [R, I, C], rounded to 6.

split: open-access


prompt:
Cross-track offsets are scaled by the angular momentum magnitude.

Input [rc, vc, rd]: chief position and velocity and deputy position. R=rc/|rc|, C=(rc x vc)/|rc x vc|, I=C x R. Return the deputy offset rd-rc projected onto [R, I, C], rounded to 6.

split: open-access


prompt:
Every RIC component has the wrong sign.

Input [rc, vc, rd]: chief position and velocity and deputy position. R=rc/|rc|, C=(rc x vc)/|rc x vc|, I=C x R. Return the deputy offset rd-rc projected onto [R, I, C], rounded to 6.

split: open-access


prompt:
Radial offsets are multiplied by the orbit radius.

Input [rc, vc, rd]: chief position and velocity and deputy position. R=rc/|rc|, C=(rc x vc)/|rc x vc|, I=C x R. Return the deputy offset rd-rc projected onto [R, I, C], rounded to 6.

split: open-access


prompt:
The target gets further ahead after the phasing orbit.

Input [r, theta, k, mu, rmin]: circular radius, target lead angle in degrees (positive = target ahead), k phasing revolutions. Phasing period Tph=T-theta_rad/(k n). a_ph from Tph; total dv = 2|v_ph(r)-v_circ| with vis-viva at r. Return None if the phasing perigee 2a_ph-r is below rmin, else [a_ph rounded 3, dv rounded 6, k*Tph rounded 3].

split: open-access


prompt:
Multi-revolution phasing orbits are far too eccentric.

Input [r, theta, k, mu, rmin]: circular radius, target lead angle in degrees (positive = target ahead), k phasing revolutions. Phasing period Tph=T-theta_rad/(k n). a_ph from Tph; total dv = 2|v_ph(r)-v_circ| with vis-viva at r. Return None if the phasing perigee 2a_ph-r is below rmin, else [a_ph rounded 3, dv rounded 6, k*Tph rounded 3].

split: open-access


prompt:
The delta-v budget omits the burn that recircularizes.

Input [r, theta, k, mu, rmin]: circular radius, target lead angle in degrees (positive = target ahead), k phasing revolutions. Phasing period Tph=T-theta_rad/(k n). a_ph from Tph; total dv = 2|v_ph(r)-v_circ| with vis-viva at r. Return None if the phasing perigee 2a_ph-r is below rmin, else [a_ph rounded 3, dv rounded 6, k*Tph rounded 3].

split: open-access


prompt:
Burn magnitudes are wrong for every eccentric phasing orbit.

Input [r, theta, k, mu, rmin]: circular radius, target lead angle in degrees (positive = target ahead), k phasing revolutions. Phasing period Tph=T-theta_rad/(k n). a_ph from Tph; total dv = 2|v_ph(r)-v_circ| with vis-viva at r. Return None if the phasing perigee 2a_ph-r is below rmin, else [a_ph rounded 3, dv rounded 6, k*Tph rounded 3].

split: open-access


prompt:
Phasing orbits that dip into the atmosphere are accepted.

Input [r, theta, k, mu, rmin]: circular radius, target lead angle in degrees (positive = target ahead), k phasing revolutions. Phasing period Tph=T-theta_rad/(k n). a_ph from Tph; total dv = 2|v_ph(r)-v_circ| with vis-viva at r. Return None if the phasing perigee 2a_ph-r is below rmin, else [a_ph rounded 3, dv rounded 6, k*Tph rounded 3].

split: open-access


prompt:
Departure burns are underestimated.

Input [r, vinf, mu]: circular parking radius and required hyperbolic excess speed. Periapsis speed vp=sqrt(vinf^2+2mu/r); burn dv=vp-sqrt(mu/r); eccentricity e=1+r vinf^2/mu; turn angle delta=2 asin(1/e) in degrees. Return [vp, dv, e rounded 6, delta rounded 4].

split: open-access


prompt:
Departure burn equals only the excess over escape.

Input [r, vinf, mu]: circular parking radius and required hyperbolic excess speed. Periapsis speed vp=sqrt(vinf^2+2mu/r); burn dv=vp-sqrt(mu/r); eccentricity e=1+r vinf^2/mu; turn angle delta=2 asin(1/e) in degrees. Return [vp, dv, e rounded 6, delta rounded 4].

split: open-access


prompt:
Hyperbola shape is wrong for any vinf other than one.

Input [r, vinf, mu]: circular parking radius and required hyperbolic excess speed. Periapsis speed vp=sqrt(vinf^2+2mu/r); burn dv=vp-sqrt(mu/r); eccentricity e=1+r vinf^2/mu; turn angle delta=2 asin(1/e) in degrees. Return [vp, dv, e rounded 6, delta rounded 4].

split: open-access


prompt:
Flyby bending is underestimated by half.

Input [r, vinf, mu]: circular parking radius and required hyperbolic excess speed. Periapsis speed vp=sqrt(vinf^2+2mu/r); burn dv=vp-sqrt(mu/r); eccentricity e=1+r vinf^2/mu; turn angle delta=2 asin(1/e) in degrees. Return [vp, dv, e rounded 6, delta rounded 4].

split: open-access


prompt:
Features east of the antimeridian or given in [180, 540) ranges land off the projected world extent.

Input [lon, lat] in degrees. Longitude is first wrapped into the half-open range [-180, 180); latitude is clamped to +/-85.05112878. Return [x, y] metres on a sphere of radius 6378137 with y growing northward, each rounded to 3 decimals.

split: open-access


prompt:
Polar latitudes project far outside the square web mercator extent.

Input [lon, lat] in degrees. Longitude is first wrapped into the half-open range [-180, 180); latitude is clamped to +/-85.05112878. Return [x, y] metres on a sphere of radius 6378137 with y growing northward, each rounded to 3 decimals.

split: open-access


prompt:
Northings are wildly exaggerated even at mid latitudes.

Input [lon, lat] in degrees. Longitude is first wrapped into the half-open range [-180, 180); latitude is clamped to +/-85.05112878. Return [x, y] metres on a sphere of radius 6378137 with y growing northward, each rounded to 3 decimals.

split: open-access


prompt:
Eastings are 57 times too large.

Input [lon, lat] in degrees. Longitude is first wrapped into the half-open range [-180, 180); latitude is clamped to +/-85.05112878. Return [x, y] metres on a sphere of radius 6378137 with y growing northward, each rounded to 3 decimals.

split: open-access


prompt:
The map is mirrored north-south.

Input [lon, lat] in degrees. Longitude is first wrapped into the half-open range [-180, 180); latitude is clamped to +/-85.05112878. Return [x, y] metres on a sphere of radius 6378137 with y growing northward, each rounded to 3 decimals.

split: open-access


prompt:
Every latitude away from the equator comes back halved.

Input [x, y] metres (sphere radius 6378137). Eastings outside the world extent E = 20037508.342789244 are wrapped into [-E, E) first. Return [lon, lat] in degrees rounded to 7 decimals.

split: open-access


prompt:
Latitudes come back with the wrong hemisphere.

Input [x, y] metres (sphere radius 6378137). Eastings outside the world extent E = 20037508.342789244 are wrapped into [-E, E) first. Return [lon, lat] in degrees rounded to 7 decimals.

split: open-access


prompt:
Positions from wrapped world copies return longitudes in the western hemisphere only.

Input [x, y] metres (sphere radius 6378137). Eastings outside the world extent E = 20037508.342789244 are wrapped into [-E, E) first. Return [lon, lat] in degrees rounded to 7 decimals.

split: open-access


prompt:
Longitudes are returned in radians.

Input [x, y] metres (sphere radius 6378137). Eastings outside the world extent E = 20037508.342789244 are wrapped into [-E, E) first. Return [lon, lat] in degrees rounded to 7 decimals.

split: open-access


prompt:
Latitudes are returned in radians.

Input [x, y] metres (sphere radius 6378137). Eastings outside the world extent E = 20037508.342789244 are wrapped into [-E, E) first. Return [lon, lat] in degrees rounded to 7 decimals.

split: open-access


prompt:
Tile indices are half of the expected values and zoom 0 produces fractional grid sizes.

Input [lon, lat, z] with lon in [-180, 180], any latitude, z >= 0. With n = 2**z tiles per axis, column = floor((lon+180)/360*n) and row = floor((1 - asinh(tan(lat))/pi)/2*n) (row 0 at the north edge); both are clamped to [0, n-1] so lon=180 falls in the last column and latitudes beyond the mercator limit fall in the edge rows. Return [z, column, row].

split: open-access


prompt:
Northern cities are fetched from southern tile rows.

Input [lon, lat, z] with lon in [-180, 180], any latitude, z >= 0. With n = 2**z tiles per axis, column = floor((lon+180)/360*n) and row = floor((1 - asinh(tan(lat))/pi)/2*n) (row 0 at the north edge); both are clamped to [0, n-1] so lon=180 falls in the last column and latitudes beyond the mercator limit fall in the edge rows. Return [z, column, row].

split: open-access


prompt:
Points exactly on the antimeridian at +180 are placed in column 0 or beyond the grid.

Input [lon, lat, z] with lon in [-180, 180], any latitude, z >= 0. With n = 2**z tiles per axis, column = floor((lon+180)/360*n) and row = floor((1 - asinh(tan(lat))/pi)/2*n) (row 0 at the north edge); both are clamped to [0, n-1] so lon=180 falls in the last column and latitudes beyond the mercator limit fall in the edge rows. Return [z, column, row].

split: open-access


prompt:
Latitudes beyond the mercator limit produce negative row numbers.

Input [lon, lat, z] with lon in [-180, 180], any latitude, z >= 0. With n = 2**z tiles per axis, column = floor((lon+180)/360*n) and row = floor((1 - asinh(tan(lat))/pi)/2*n) (row 0 at the north edge); both are clamped to [0, n-1] so lon=180 falls in the last column and latitudes beyond the mercator limit fall in the edge rows. Return [z, column, row].

split: open-access


prompt:
Points in the eastern half of a tile are assigned to the next column.

Input [lon, lat, z] with lon in [-180, 180], any latitude, z >= 0. With n = 2**z tiles per axis, column = floor((lon+180)/360*n) and row = floor((1 - asinh(tan(lat))/pi)/2*n) (row 0 at the north edge); both are clamped to [0, n-1] so lon=180 falls in the last column and latitudes beyond the mercator limit fall in the edge rows. Return [z, column, row].

split: open-access


prompt:
TMS tiles report bounds one tile further south than their neighbours report.

Input [z, col, row, scheme] where scheme is "xyz" (row 0 at north) or "tms" (row 0 at south). Return [west, south, east, north] in degrees rounded to 6 decimals, using lon = col/n*360-180 and lat = degrees(atan(sinh(pi*(1-2*r/n)))) for an xyz row edge r, n = 2**z. A tms row t is the xyz row n-1-t.

split: open-access


prompt:
Tiles have zero height: north equals south.

Input [z, col, row, scheme] where scheme is "xyz" (row 0 at north) or "tms" (row 0 at south). Return [west, south, east, north] in degrees rounded to 6 decimals, using lon = col/n*360-180 and lat = degrees(atan(sinh(pi*(1-2*r/n)))) for an xyz row edge r, n = 2**z. A tms row t is the xyz row n-1-t.

split: open-access


prompt:
All tile edges crowd toward the north, the south half of the world disappears.

Input [z, col, row, scheme] where scheme is "xyz" (row 0 at north) or "tms" (row 0 at south). Return [west, south, east, north] in degrees rounded to 6 decimals, using lon = col/n*360-180 and lat = degrees(atan(sinh(pi*(1-2*r/n)))) for an xyz row edge r, n = 2**z. A tms row t is the xyz row n-1-t.

split: open-access


prompt:
Tiles have zero width: west equals east.

Input [z, col, row, scheme] where scheme is "xyz" (row 0 at north) or "tms" (row 0 at south). Return [west, south, east, north] in degrees rounded to 6 decimals, using lon = col/n*360-180 and lat = degrees(atan(sinh(pi*(1-2*r/n)))) for an xyz row edge r, n = 2**z. A tms row t is the xyz row n-1-t.

split: open-access


prompt:
Western tile edges drift east of the matching eastern edge of the neighbour tile.

Input [z, col, row, scheme] where scheme is "xyz" (row 0 at north) or "tms" (row 0 at south). Return [west, south, east, north] in degrees rounded to 6 decimals, using lon = col/n*360-180 and lat = degrees(atan(sinh(pi*(1-2*r/n)))) for an xyz row edge r, n = 2**z. A tms row t is the xyz row n-1-t.

split: open-access


prompt:
Quadkeys of neighbouring tiles no longer share their parent prefix.

Input [z, col, row] with xyz rows. For zoom 0 return the empty string. If col or row is outside [0, 2**z - 1] return None. Otherwise emit z digits from the most significant bit down: digit = (1 if col bit set) + (2 if row bit set).

split: open-access


prompt:
Keys read the wrong bit and tiles in odd columns get even-column keys.

Input [z, col, row] with xyz rows. For zoom 0 return the empty string. If col or row is outside [0, 2**z - 1] return None. Otherwise emit z digits from the most significant bit down: digit = (1 if col bit set) + (2 if row bit set).

split: open-access


prompt:
East and south quadrants are confused in generated keys.

Input [z, col, row] with xyz rows. For zoom 0 return the empty string. If col or row is outside [0, 2**z - 1] return None. Otherwise emit z digits from the most significant bit down: digit = (1 if col bit set) + (2 if row bit set).

split: open-access


prompt:
The world tile at zoom 0 gets a one-character key that collides with a zoom-1 tile.

Input [z, col, row] with xyz rows. For zoom 0 return the empty string. If col or row is outside [0, 2**z - 1] return None. Otherwise emit z digits from the most significant bit down: digit = (1 if col bit set) + (2 if row bit set).

split: open-access


prompt:
Tiles one past the grid edge get keys instead of being rejected.

Input [z, col, row] with xyz rows. For zoom 0 return the empty string. If col or row is outside [0, 2**z - 1] return None. Otherwise emit z digits from the most significant bit down: digit = (1 if col bit set) + (2 if row bit set).

split: open-access


prompt:
Resolution oscillates and even turns negative across latitudes.

Input [lat, z, tile_size, dpi]. Ground resolution in metres per pixel is 2*pi*6378137*cos(lat)/(tile_size*2**z) with the equatorial circumference computed exactly. The map scale denominator is resolution*dpi/0.0254. Return [resolution rounded to 6 decimals, scale denominator rounded to the nearest integer] computed from the unrounded resolution.

split: open-access


prompt:
512-pixel tile pyramids report four times the true metres per pixel.

Input [lat, z, tile_size, dpi]. Ground resolution in metres per pixel is 2*pi*6378137*cos(lat)/(tile_size*2**z) with the equatorial circumference computed exactly. The map scale denominator is resolution*dpi/0.0254. Return [resolution rounded to 6 decimals, scale denominator rounded to the nearest integer] computed from the unrounded resolution.

split: open-access


prompt:
Every zoom level reports half the correct resolution.

Input [lat, z, tile_size, dpi]. Ground resolution in metres per pixel is 2*pi*6378137*cos(lat)/(tile_size*2**z) with the equatorial circumference computed exactly. The map scale denominator is resolution*dpi/0.0254. Return [resolution rounded to 6 decimals, scale denominator rounded to the nearest integer] computed from the unrounded resolution.

split: open-access


prompt:
Scale denominators are ten times too small.

Input [lat, z, tile_size, dpi]. Ground resolution in metres per pixel is 2*pi*6378137*cos(lat)/(tile_size*2**z) with the equatorial circumference computed exactly. The map scale denominator is resolution*dpi/0.0254. Return [resolution rounded to 6 decimals, scale denominator rounded to the nearest integer] computed from the unrounded resolution.

split: open-access


prompt:
Scale denominators at high zoom levels are off by several hundred.

Input [lat, z, tile_size, dpi]. Ground resolution in metres per pixel is 2*pi*6378137*cos(lat)/(tile_size*2**z) with the equatorial circumference computed exactly. The map scale denominator is resolution*dpi/0.0254. Return [resolution rounded to 6 decimals, scale denominator rounded to the nearest integer] computed from the unrounded resolution.

split: open-access


prompt:
Points exactly on +180 get a non-existent zone 61.

Input [lon, lat]. zone = floor((lon+180)/6)+1, with lon=180 mapped to zone 60. Exceptions: lat in [56, 64) and lon in [3, 12) is zone 32; lat in [72, 84] uses zone 31 for lon in [0, 9), 33 for [9, 21), 35 for [21, 33) and 37 for [33, 42). Band letters "CDEFGHJKLMNPQRSTUVWX" (no I or O) cover 8 degrees each from -80; band X also covers up to 84 inclusive. Outside [-80, 84] the band is None. Return [zone, band].

split: open-access


prompt:
Points on the 3 degree meridian in southern Norway stay in zone 31.

Input [lon, lat]. zone = floor((lon+180)/6)+1, with lon=180 mapped to zone 60. Exceptions: lat in [56, 64) and lon in [3, 12) is zone 32; lat in [72, 84] uses zone 31 for lon in [0, 9), 33 for [9, 21), 35 for [21, 33) and 37 for [33, 42). Band letters "CDEFGHJKLMNPQRSTUVWX" (no I or O) cover 8 degrees each from -80; band X also covers up to 84 inclusive. Outside [-80, 84] the band is None. Return [zone, band].

split: open-access


prompt:
Svalbard points near 21 degrees east are assigned to the wrong widened zone.

Input [lon, lat]. zone = floor((lon+180)/6)+1, with lon=180 mapped to zone 60. Exceptions: lat in [56, 64) and lon in [3, 12) is zone 32; lat in [72, 84] uses zone 31 for lon in [0, 9), 33 for [9, 21), 35 for [21, 33) and 37 for [33, 42). Band letters "CDEFGHJKLMNPQRSTUVWX" (no I or O) cover 8 degrees each from -80; band X also covers up to 84 inclusive. Outside [-80, 84] the band is None. Return [zone, band].

split: open-access


prompt:
Points in the 12-degree band X above 80N are labelled C.

Input [lon, lat]. zone = floor((lon+180)/6)+1, with lon=180 mapped to zone 60. Exceptions: lat in [56, 64) and lon in [3, 12) is zone 32; lat in [72, 84] uses zone 31 for lon in [0, 9), 33 for [9, 21), 35 for [21, 33) and 37 for [33, 42). Band letters "CDEFGHJKLMNPQRSTUVWX" (no I or O) cover 8 degrees each from -80; band X also covers up to 84 inclusive. Outside [-80, 84] the band is None. Return [zone, band].

split: open-access


prompt:
Points on the southern and northern band limits lose their band letter.

Input [lon, lat]. zone = floor((lon+180)/6)+1, with lon=180 mapped to zone 60. Exceptions: lat in [56, 64) and lon in [3, 12) is zone 32; lat in [72, 84] uses zone 31 for lon in [0, 9), 33 for [9, 21), 35 for [21, 33) and 37 for [33, 42). Band letters "CDEFGHJKLMNPQRSTUVWX" (no I or O) cover 8 degrees each from -80; band X also covers up to 84 inclusive. Outside [-80, 84] the band is None. Return [zone, band].

split: open-access


prompt:
Eastings are offset by roughly 330 km in every zone.

Input [lon, lat, zone, hemisphere] with |lat| <= 80 and lon within 4 degrees of the zone central meridian 6*zone-183. On a sphere R = 6371000 with k0 = 0.9996: B = cos(phi)*sin(dl); x = 0.5*k0*R*ln((1+B)/(1-B)); y = k0*R*atan2(tan(phi), cos(dl)). Easting = 500000 + x. Northing = y plus 10000000 when the requested grid hemisphere is "S" (the caller may deliberately project points just north of the equator in a southern grid). Return [easting, northing] rounded to 2 decimals.

split: open-access


prompt:
Points just north of the equator in a southern grid jump by ten thousand kilometres.

Input [lon, lat, zone, hemisphere] with |lat| <= 80 and lon within 4 degrees of the zone central meridian 6*zone-183. On a sphere R = 6371000 with k0 = 0.9996: B = cos(phi)*sin(dl); x = 0.5*k0*R*ln((1+B)/(1-B)); y = k0*R*atan2(tan(phi), cos(dl)). Easting = 500000 + x. Northing = y plus 10000000 when the requested grid hemisphere is "S" (the caller may deliberately project points just north of the equator in a southern grid). Return [easting, northing] rounded to 2 decimals.

split: open-access


prompt:
Distances from the central meridian are doubled.

Input [lon, lat, zone, hemisphere] with |lat| <= 80 and lon within 4 degrees of the zone central meridian 6*zone-183. On a sphere R = 6371000 with k0 = 0.9996: B = cos(phi)*sin(dl); x = 0.5*k0*R*ln((1+B)/(1-B)); y = k0*R*atan2(tan(phi), cos(dl)). Easting = 500000 + x. Northing = y plus 10000000 when the requested grid hemisphere is "S" (the caller may deliberately project points just north of the equator in a southern grid). Return [easting, northing] rounded to 2 decimals.

split: open-access


prompt:
Northings are wrong for points away from the central meridian.

Input [lon, lat, zone, hemisphere] with |lat| <= 80 and lon within 4 degrees of the zone central meridian 6*zone-183. On a sphere R = 6371000 with k0 = 0.9996: B = cos(phi)*sin(dl); x = 0.5*k0*R*ln((1+B)/(1-B)); y = k0*R*atan2(tan(phi), cos(dl)). Easting = 500000 + x. Northing = y plus 10000000 when the requested grid hemisphere is "S" (the caller may deliberately project points just north of the equator in a southern grid). Return [easting, northing] rounded to 2 decimals.

split: open-access


prompt:
The zone is mirrored about its central meridian.

Input [lon, lat, zone, hemisphere] with |lat| <= 80 and lon within 4 degrees of the zone central meridian 6*zone-183. On a sphere R = 6371000 with k0 = 0.9996: B = cos(phi)*sin(dl); x = 0.5*k0*R*ln((1+B)/(1-B)); y = k0*R*atan2(tan(phi), cos(dl)). Easting = 500000 + x. Northing = y plus 10000000 when the requested grid hemisphere is "S" (the caller may deliberately project points just north of the equator in a southern grid). Return [easting, northing] rounded to 2 decimals.

split: open-access


prompt:
Horizontal scale is correct only when the origin latitude equals the standard parallel.

Input [mode, a, b, lon0, lat0, lat1] on a sphere R = 6371007. mode "fwd": a=lon, b=lat; dlon = lon-lon0 wrapped into [-180, 180); x = R*rad(dlon)*cos(rad(lat1)), y = R*rad(lat-lat0). mode "inv": a=x, b=y; lon = lon0 + deg(x/(R*cos(rad(lat1)))) wrapped into [-180, 180), lat = lat0 + deg(y/R). Forward results round to 2 decimals, inverse results to 6.

split: open-access


prompt:
Points across the antimeridian from the central meridian project a whole world-width away.

Input [mode, a, b, lon0, lat0, lat1] on a sphere R = 6371007. mode "fwd": a=lon, b=lat; dlon = lon-lon0 wrapped into [-180, 180); x = R*rad(dlon)*cos(rad(lat1)), y = R*rad(lat-lat0). mode "inv": a=x, b=y; lon = lon0 + deg(x/(R*cos(rad(lat1)))) wrapped into [-180, 180), lat = lat0 + deg(y/R). Forward results round to 2 decimals, inverse results to 6.

split: open-access


prompt:
Northings ignore the grid origin latitude.

Input [mode, a, b, lon0, lat0, lat1] on a sphere R = 6371007. mode "fwd": a=lon, b=lat; dlon = lon-lon0 wrapped into [-180, 180); x = R*rad(dlon)*cos(rad(lat1)), y = R*rad(lat-lat0). mode "inv": a=x, b=y; lon = lon0 + deg(x/(R*cos(rad(lat1)))) wrapped into [-180, 180), lat = lat0 + deg(y/R). Forward results round to 2 decimals, inverse results to 6.

split: open-access


prompt:
Inverse longitudes shrink toward the central meridian.

Input [mode, a, b, lon0, lat0, lat1] on a sphere R = 6371007. mode "fwd": a=lon, b=lat; dlon = lon-lon0 wrapped into [-180, 180); x = R*rad(dlon)*cos(rad(lat1)), y = R*rad(lat-lat0). mode "inv": a=x, b=y; lon = lon0 + deg(x/(R*cos(rad(lat1)))) wrapped into [-180, 180), lat = lat0 + deg(y/R). Forward results round to 2 decimals, inverse results to 6.

split: open-access


prompt:
Inverse results near the antimeridian report longitudes beyond 180.

Input [mode, a, b, lon0, lat0, lat1] on a sphere R = 6371007. mode "fwd": a=lon, b=lat; dlon = lon-lon0 wrapped into [-180, 180); x = R*rad(dlon)*cos(rad(lat1)), y = R*rad(lat-lat0). mode "inv": a=x, b=y; lon = lon0 + deg(x/(R*cos(rad(lat1)))) wrapped into [-180, 180), lat = lat0 + deg(y/R). Forward results round to 2 decimals, inverse results to 6.

split: open-access


prompt:
Inverse latitudes are offset when the grid origin is not on the equator.

Input [mode, a, b, lon0, lat0, lat1] on a sphere R = 6371007. mode "fwd": a=lon, b=lat; dlon = lon-lon0 wrapped into [-180, 180); x = R*rad(dlon)*cos(rad(lat1)), y = R*rad(lat-lat0). mode "inv": a=x, b=y; lon = lon0 + deg(x/(R*cos(rad(lat1)))) wrapped into [-180, 180), lat = lat0 + deg(y/R). Forward results round to 2 decimals, inverse results to 6.

split: open-access


prompt:
Pixels exactly on the pole rows are reported as outside the map.

Input [x, y, lon0] metres on a sphere R = 6371007. lat = y/R radians; if |lat| > pi/2 return None. If cos(lat) < 1e-12 (a pole) return [lon0, +/-90]. Otherwise dl = x/(R*cos(lat)); if |dl| > pi the point is outside the map outline and None is returned. lon = lon0 + deg(dl) wrapped to [-180, 180). Return [lon, lat] degrees rounded to 6 decimals.

split: open-access


prompt:
High-latitude fill pixels outside the outline decode to bogus longitudes.

Input [x, y, lon0] metres on a sphere R = 6371007. lat = y/R radians; if |lat| > pi/2 return None. If cos(lat) < 1e-12 (a pole) return [lon0, +/-90]. Otherwise dl = x/(R*cos(lat)); if |dl| > pi the point is outside the map outline and None is returned. lon = lon0 + deg(dl) wrapped to [-180, 180). Return [lon, lat] degrees rounded to 6 decimals.

split: open-access


prompt:
Longitudes away from the equator are compressed toward the central meridian.

Input [x, y, lon0] metres on a sphere R = 6371007. lat = y/R radians; if |lat| > pi/2 return None. If cos(lat) < 1e-12 (a pole) return [lon0, +/-90]. Otherwise dl = x/(R*cos(lat)); if |dl| > pi the point is outside the map outline and None is returned. lon = lon0 + deg(dl) wrapped to [-180, 180). Return [lon, lat] degrees rounded to 6 decimals.

split: open-access


prompt:
Rows beyond the poles are decoded as valid latitudes.

Input [x, y, lon0] metres on a sphere R = 6371007. lat = y/R radians; if |lat| > pi/2 return None. If cos(lat) < 1e-12 (a pole) return [lon0, +/-90]. Otherwise dl = x/(R*cos(lat)); if |dl| > pi the point is outside the map outline and None is returned. lon = lon0 + deg(dl) wrapped to [-180, 180). Return [lon, lat] degrees rounded to 6 decimals.

split: open-access


prompt:
Pixels near the outline on shifted central meridians report longitudes beyond 180.

Input [x, y, lon0] metres on a sphere R = 6371007. lat = y/R radians; if |lat| > pi/2 return None. If cos(lat) < 1e-12 (a pole) return [lon0, +/-90]. Otherwise dl = x/(R*cos(lat)); if |dl| > pi the point is outside the map outline and None is returned. lon = lon0 + deg(dl) wrapped to [-180, 180). Return [lon, lat] degrees rounded to 6 decimals.

split: open-access


prompt:
Single-parallel conic grids are badly distorted while secant grids look fine.

Input [lon, lat, lon0, lat0, lat1, lat2] degrees, sphere R = 6371000, all latitudes strictly inside (-90, 90) and on the cone side of the equator. t(p) = tan(pi/4 + p/2). n = ln(cos p1/cos p2)/ln(t(p2)/t(p1)), or sin(p1) for a tangent cone (lat1 == lat2). F = cos(p1)*t(p1)**n/n; rho = R*F/t(phi)**n; rho0 = R*F/t(p0)**n; theta = n*dlon with dlon wrapped to [-180, 180). x = rho*sin(theta), y = rho0 - rho*cos(theta), rounded to 2 decimals.

split: open-access


prompt:
Secant cones open the wrong way and produce mirrored, inflated output.

Input [lon, lat, lon0, lat0, lat1, lat2] degrees, sphere R = 6371000, all latitudes strictly inside (-90, 90) and on the cone side of the equator. t(p) = tan(pi/4 + p/2). n = ln(cos p1/cos p2)/ln(t(p2)/t(p1)), or sin(p1) for a tangent cone (lat1 == lat2). F = cos(p1)*t(p1)**n/n; rho = R*F/t(phi)**n; rho0 = R*F/t(p0)**n; theta = n*dlon with dlon wrapped to [-180, 180). x = rho*sin(theta), y = rho0 - rho*cos(theta), rounded to 2 decimals.

split: open-access


prompt:
The whole map is scaled by the cone constant.

Input [lon, lat, lon0, lat0, lat1, lat2] degrees, sphere R = 6371000, all latitudes strictly inside (-90, 90) and on the cone side of the equator. t(p) = tan(pi/4 + p/2). n = ln(cos p1/cos p2)/ln(t(p2)/t(p1)), or sin(p1) for a tangent cone (lat1 == lat2). F = cos(p1)*t(p1)**n/n; rho = R*F/t(phi)**n; rho0 = R*F/t(p0)**n; theta = n*dlon with dlon wrapped to [-180, 180). x = rho*sin(theta), y = rho0 - rho*cos(theta), rounded to 2 decimals.

split: open-access


prompt:
False origins are shifted north or south by hundreds of kilometres.

Input [lon, lat, lon0, lat0, lat1, lat2] degrees, sphere R = 6371000, all latitudes strictly inside (-90, 90) and on the cone side of the equator. t(p) = tan(pi/4 + p/2). n = ln(cos p1/cos p2)/ln(t(p2)/t(p1)), or sin(p1) for a tangent cone (lat1 == lat2). F = cos(p1)*t(p1)**n/n; rho = R*F/t(phi)**n; rho0 = R*F/t(p0)**n; theta = n*dlon with dlon wrapped to [-180, 180). x = rho*sin(theta), y = rho0 - rho*cos(theta), rounded to 2 decimals.

split: open-access


prompt:
Meridian spacing grows the wrong way with latitude.

Input [lon, lat, lon0, lat0, lat1, lat2] degrees, sphere R = 6371000, all latitudes strictly inside (-90, 90) and on the cone side of the equator. t(p) = tan(pi/4 + p/2). n = ln(cos p1/cos p2)/ln(t(p2)/t(p1)), or sin(p1) for a tangent cone (lat1 == lat2). F = cos(p1)*t(p1)**n/n; rho = R*F/t(phi)**n; rho0 = R*F/t(p0)**n; theta = n*dlon with dlon wrapped to [-180, 180). x = rho*sin(theta), y = rho0 - rho*cos(theta), rounded to 2 decimals.

split: open-access


prompt:
Meridians fan out as if the cone were flat.

Input [lon, lat, lon0, lat0, lat1, lat2] degrees, sphere R = 6371000, all latitudes strictly inside (-90, 90) and on the cone side of the equator. t(p) = tan(pi/4 + p/2). n = ln(cos p1/cos p2)/ln(t(p2)/t(p1)), or sin(p1) for a tangent cone (lat1 == lat2). F = cos(p1)*t(p1)**n/n; rho = R*F/t(phi)**n; rho0 = R*F/t(p0)**n; theta = n*dlon with dlon wrapped to [-180, 180). x = rho*sin(theta), y = rho0 - rho*cos(theta), rounded to 2 decimals.

split: open-access


prompt:
Area totals drift and meridians converge twice as fast as intended.

Input [lon, lat, lon0, lat0, lat1, lat2] degrees, sphere R = 6371000, lat1 != -lat2. n = (sin p1 + sin p2)/2; C = cos(p1)**2 + 2*n*sin(p1); rho = R*sqrt(C - 2*n*sin(phi))/n; rho0 likewise at lat0; theta = n*dlon with dlon wrapped to [-180, 180). x = rho*sin(theta), y = rho0 - rho*cos(theta), rounded to 2 decimals.

split: open-access


prompt:
Radii are wrong on every parallel so equal areas are lost.

Input [lon, lat, lon0, lat0, lat1, lat2] degrees, sphere R = 6371000, lat1 != -lat2. n = (sin p1 + sin p2)/2; C = cos(p1)**2 + 2*n*sin(p1); rho = R*sqrt(C - 2*n*sin(phi))/n; rho0 likewise at lat0; theta = n*dlon with dlon wrapped to [-180, 180). x = rho*sin(theta), y = rho0 - rho*cos(theta), rounded to 2 decimals.

split: open-access


prompt:
Parallel spacing is wrong and southern cones fail outright.

Input [lon, lat, lon0, lat0, lat1, lat2] degrees, sphere R = 6371000, lat1 != -lat2. n = (sin p1 + sin p2)/2; C = cos(p1)**2 + 2*n*sin(p1); rho = R*sqrt(C - 2*n*sin(phi))/n; rho0 likewise at lat0; theta = n*dlon with dlon wrapped to [-180, 180). x = rho*sin(theta), y = rho0 - rho*cos(theta), rounded to 2 decimals.

split: open-access


prompt:
False northings are measured from a standard parallel instead of the grid origin.

Input [lon, lat, lon0, lat0, lat1, lat2] degrees, sphere R = 6371000, lat1 != -lat2. n = (sin p1 + sin p2)/2; C = cos(p1)**2 + 2*n*sin(p1); rho = R*sqrt(C - 2*n*sin(phi))/n; rho0 likewise at lat0; theta = n*dlon with dlon wrapped to [-180, 180). x = rho*sin(theta), y = rho0 - rho*cos(theta), rounded to 2 decimals.

split: open-access