{"version":3,"sources":["../src/auxiliary-functions.ts","../src/coordinate-transforms.ts","../src/frames.ts","../src/in-plane-stm.ts","../src/out-of-plane-stm.ts","../src/yamanaka-ankersen.ts","../src/clohessy-wiltshire.ts","../src/kepler-utils.ts"],"names":["c"],"mappings":";;;;;;AAoBO,IAAM,GAAA,2BAAO,CAAA,EAAW,KAAA,KAC7B,IAAI,CAAA,GAAI,IAAA,CAAK,GAAA,CAAI,KAAK,CAAA,EADL,KAAA;AAaZ,IAAM,CAAA,mBAAI,MAAA,CAAA,CAAC,CAAA,EAAW,KAAA,KAA+B;AAC1D,EAAA,MAAM,MAAA,GAAS,GAAA,CAAI,CAAA,EAAG,KAAK,CAAA;AAC3B,EAAA,OAAO,MAAA,GAAS,IAAA,CAAK,GAAA,CAAI,KAAK,CAAA;AAChC,CAAA,EAHiB,GAAA;AAeV,IAAM,CAAA,mBAAI,MAAA,CAAA,CAAC,CAAA,EAAW,KAAA,KAA+B;AAC1D,EAAA,MAAM,MAAA,GAAS,GAAA,CAAI,CAAA,EAAG,KAAK,CAAA;AAC3B,EAAA,OAAO,MAAA,GAAS,IAAA,CAAK,GAAA,CAAI,KAAK,CAAA;AAChC,CAAA,EAHiB,GAAA;AAeV,IAAM,MAAA,mBAAS,MAAA,CAAA,CAAC,CAAA,EAAW,KAAA,KAChC,IAAA,CAAK,GAAA,CAAI,KAAK,CAAA,GAAI,CAAA,GAAI,IAAA,CAAK,GAAA,CAAI,CAAA,GAAI,KAAK,CAAA,EADpB,QAAA;AAaf,IAAM,MAAA,mBAAS,MAAA,CAAA,CAAC,CAAA,EAAW,KAAA,KAChC,EAAE,IAAA,CAAK,GAAA,CAAI,KAAK,CAAA,GAAI,CAAA,GAAI,IAAA,CAAK,GAAA,CAAI,CAAA,GAAI,KAAK,CAAA,CAAA,EADtB,QAAA;AAgBf,IAAM,QAAA,2BAAY,QAAA,KAAsC;AAC7D,EAAA,MAAM,EAAE,sBAAA,EAAwB,EAAA,EAAI,eAAA,EAAiB,G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ACJ,eAAA,EAAiB,CAAA;AAAA,IACjB,sBAAA,EAAwB,EAAA;AAAA,IACxB,YAAA,EAAc;AAAA,GAChB,GAAI,QAAA;AACJ,EAAA,MAAM,CAAA,GAAK,CAAA,GAAI,CAAA,IAAM,EAAA,IAAM,IAAI,CAAA,GAAI,CAAA,CAAA,CAAA;AACnC,EAAA,OAAO,CAAA,GAAI,KAAK,EAAA,GAAK,IAAA,CAAK,KAAM,CAAA,GAAI,CAAA,GAAI,IAAK,EAAE,CAAA;AACjD,CAAA,EAR6B,eAAA;AAuBtB,IAAM,qBAAA,mBAA+C,MAAA,CAAA,CAC1D,YAAA,EACA,mBAAA,EACA,EAAA,KACW;AACX,EAAA,IAAI,EAAE,YAAA,IAAgB,CAAA,IAAK,YAAA,GAAe,CAAA,CAAA,EAAI;AAC5C,IAAA,MAAM,IAAI,MAAM,gCAAgC,CAAA;AAAA,EAClD;AACA,EAAA,IAAI,EAAE,sBAAsB,CAAA,CAAA,EAAI;AAC9B,IAAA,MAAM,IAAI,MAAM,kCAAkC,CAAA;AAAA,EACpD;AAEA,EAAA,MAAM,UAAA,GAAc,mBAAA,GAAsB,CAAA,GAAI,IAAA,CAAK,EAAA,GAAM,KAAA;AACzD,EAAA,MAAM,CAAA,GAAI,IAAA,CAAK,IAAA,CAAK,EAAA,IAAM,aAAa,UAAA,CAAW,CAAA;AAClD,EAAA,OAAO,KAAK,IAAA,CAAK,EAAA,GAAK,CAAA,IAAK,CAAA,GAAI,eAAe,YAAA,CAAa,CAAA;AAC7D,CAAA,EAf4D,uBAAA","file":"index.cjs","sourcesContent":["/**\n * Auxiliary mathematical functions for the Yamanaka-Ankersen State Transition Matrix.\n *\n * Reference: Yamanaka-Ankersen (2002), New State Transition Matrix for Relative Motion on an\n * Arbitrary Elliptical Orbit, JGCD 25(1).\n */\n\nimport type { OrbitalElements, TrueAnomaly } from \"@/types\";\n\n/**\n * Compute the auxiliary scalar rho(theta) = 1 + e*cos(theta).\n *\n * Reference: Yamanaka-Ankersen (2002), New State Transition Matrix for Relative Motion on an\n * Arbitrary Elliptical Orbit, JGCD 25(1). rho appears throughout the modified-coordinate\n * formulation and in the state transition matrices (e.g., Eq. (25) via omega = k^2*rho^2).\n *\n * @param e - Eccentricity e in [0, 1)\n * @param theta - True anomaly theta [rad]\n * @returns rho(theta) (dimensionless)\n */\nexport const rho = (e: number, theta: TrueAnomaly): number =>\n  1 + e * Math.cos(theta);\n\n/**\n * Compute s(theta) = rho(theta)*sin(theta), an auxiliary term used by the in-plane STM.\n *\n * Reference: Yamanaka-Ankersen (2002). s and c are convenient shorthands that compactly\n * express the in-plane transition relations (see Eq. (83)).\n *\n * @param e - Eccentricity e in [0, 1)\n * @param theta - True anomaly theta [rad]\n * @returns s(theta) (dimensionless)\n */\nexport const s = (e: number, theta: TrueAnomaly): number => {\n  const rhoVal = rho(e, theta);\n  return rhoVal * Math.sin(theta);\n};\n\n/**\n * Compute c(theta) = rho(theta)*cos(theta), an auxiliary term used by the in-plane STM.\n *\n * Reference: Yamanaka-Ankersen (2002). s and c are convenient shorthands that compactly\n * express the in-plane transition relations (see Eq. (83)).\n *\n * @param e - Eccentricity e in [0, 1)\n * @param theta - True anomaly theta [rad]\n * @returns c(theta) (dimensionless)\n */\nexport const c = (e: number, theta: TrueAnomaly): number => {\n  const rhoVal = rho(e, theta);\n  return rhoVal * Math.cos(theta);\n};\n\n/**\n * Compute s'(theta) = cos(theta) + e*cos(2*theta).\n *\n * Reference: Yamanaka-Ankersen (2002). s' and c' appear in the in-plane STM (Eq. (83))\n * as derivatives of auxiliary trigonometric combinations.\n *\n * @param e - Eccentricity e in [0, 1)\n * @param theta - True anomaly theta [rad]\n * @returns s'(theta) (dimensionless)\n */\nexport const sPrime = (e: number, theta: TrueAnomaly): number =>\n  Math.cos(theta) + e * Math.cos(2 * theta);\n\n/**\n * Compute c'(theta) = -(sin(theta) + e*sin(2*theta)).\n *\n * Reference: Yamanaka-Ankersen (2002). s' and c' appear in the in-plane STM (Eq. (83))\n * as derivatives of auxiliary trigonometric combinations.\n *\n * @param e - Eccentricity e in [0, 1)\n * @param theta - True anomaly theta [rad]\n * @returns c'(theta) (dimensionless)\n */\nexport const cPrime = (e: number, theta: TrueAnomaly): number =>\n  -(Math.sin(theta) + e * Math.sin(2 * theta));\n\n/**\n * Compute k^2 where k is defined as mu / h^(3/2) and thus k^2 = (mu / h^(3/2))^2.\n *\n * Reference: Yamanaka-Ankersen (2002):\n * - Eq. (14): definition of k\n * - Eq. (25): omega = k^2*rho^2\n * - Eq. (47): J(theta) = k^2*(t - t0)\n *\n * Units: k has units s^(-1/2); therefore k^2 has units s^(-1).\n *\n * @param elements - Orbital elements providing mu and h\n * @returns k^2 [s^(-1)]\n */\nexport const kSquared = (elements: OrbitalElements): number => {\n  const { gravitationalParameter: mu, angularMomentum: h } = elements;\n  const k = mu / Math.pow(h, 1.5);\n  return k * k; // Return k^2, not k\n};\n\n/**\n * Compute the Yamanaka-Ankersen scalar J via J(theta) = k^2*(t - t0).\n *\n * Reference: Yamanaka-Ankersen (2002), Eq. (47). The paper shows that the integral\n * J(theta) = integral from theta0 to theta of rho(tau)^(-2) differential tau equals k^2*(t - t0),\n * allowing time-domain propagation without directly evaluating the integral.\n *\n * @param elements - Orbital elements providing mu and h\n * @param deltaTime - Time difference (t - t0) [s]\n * @returns J (dimensionless)\n */\nexport const J = (elements: OrbitalElements, deltaTime: number): number =>\n  kSquared(elements) * deltaTime;\n","/**\n * Transformations between true and modified coordinates for the Yamanaka-Ankersen STM.\n *\n * Reference: Yamanaka-Ankersen (2002), modified-coordinate transform preceding the\n * in-plane/out-of-plane STM (see discussion around Eqs. (80)-(84)).\n */\n\nimport type {\n  OrbitalElements,\n  RelativeState,\n  TrueAnomaly,\n  Vector3,\n} from \"@/types\";\nimport { kSquared, rho } from \"@/auxiliary-functions\";\n\n/**\n * Transform a relative state from true to modified coordinates used by the YA STM.\n *\n * Definitions (as used in the paper's modified-coordinate formulation):\n * - r_tilde = rho*r\n * - v_tilde = -e*sin(theta)*r + (1 / (k^2*rho))*v\n *\n * Reference: Yamanaka-Ankersen (2002), modified-coordinate transform preceding the\n * in-plane/out-of-plane STM (see discussion around Eqs. (80)-(84)).\n *\n * @param state - Relative state in true coordinates; position [m], velocity [m/s]\n * @param elements - Orbital elements providing e, mu, h\n * @param theta - True anomaly theta at the state epoch [rad]\n * @returns Relative state expressed in modified coordinates\n */\nexport const toModifiedCoordinates = (\n  state: RelativeState,\n  elements: OrbitalElements,\n  theta: TrueAnomaly\n): RelativeState => {\n  const e = elements.eccentricity;\n  const rhoVal = rho(e, theta);\n  const k2 = kSquared(elements);\n  const eSinTheta = e * Math.sin(theta);\n\n  const position: Vector3 = [\n    rhoVal * state.position[0],\n    rhoVal * state.position[1],\n    rhoVal * state.position[2],\n  ];\n\n  const velocity: Vector3 = [\n    -eSinTheta * state.position[0] + state.velocity[0] / (k2 * rhoVal),\n    -eSinTheta * state.position[1] + state.velocity[1] / (k2 * rhoVal),\n    -eSinTheta * state.position[2] + state.velocity[2] / (k2 * rhoVal),\n  ];\n\n  return { position, velocity };\n};\n\n/**\n * Transform a relative state from modified back to true coordinates.\n *\n * Inverse relations to the modified-coordinate definitions:\n * - r = (1 / rho)*r_tilde\n * - v = k^2*(e*sin(theta)*r_tilde + rho*v_tilde)\n *\n * Reference: Yamanaka-Ankersen (2002), inverse of the modified-coordinate transform\n * (see discussion around Eqs. (80)-(84)).\n *\n * @param modifiedState - Relative state in modified coordinates\n * @param elements - Orbital elements providing e, mu, h\n * @param theta - True anomaly theta at the state epoch [rad]\n * @returns Relative state expressed in true coordinates\n */\nexport const fromModifiedCoordinates = (\n  modifiedState: RelativeState,\n  elements: OrbitalElements,\n  theta: TrueAnomaly\n): RelativeState => {\n  const e = elements.eccentricity;\n  const rhoVal = rho(e, theta);\n  const k2 = kSquared(elements);\n  const eSinTheta = e * Math.sin(theta);\n\n  const position: Vector3 = [\n    modifiedState.position[0] / rhoVal,\n    modifiedState.position[1] / rhoVal,\n    modifiedState.position[2] / rhoVal,\n  ];\n\n  const velocity: Vector3 = [\n    k2 *\n      (eSinTheta * modifiedState.position[0] +\n        rhoVal * modifiedState.velocity[0]),\n    k2 *\n      (eSinTheta * modifiedState.position[1] +\n        rhoVal * modifiedState.velocity[1]),\n    k2 *\n      (eSinTheta * modifiedState.position[2] +\n        rhoVal * modifiedState.velocity[2]),\n  ];\n\n  return { position, velocity };\n};\n","/**\n * Coordinate frame conversions between RIC and LVLH frames.\n *\n * Under the conventions in this module, the internal coordinate ordering equals LVLH:\n * - x: along-track (I)\n * - y: cross-track (C)\n * - z: radial (R)\n *\n * Therefore, conversion:\n * - LVLH [I, C, R] <-> internal [x, y, z] is identity\n * - RIC [R, I, C] <-> internal [x, y, z] is a permutation only (no inertial rotation)\n */\n\nimport type { Frame, RelativeState, Vector3 } from \"@/types\";\n\n/**\n * Convert a relative state from an external local-orbital frame (RIC/LVLH)\n * into the module's internal LVLH ordering [x=I, y=C, z=R].\n *\n * - If from = 'LVLH', this is identity (LVLH == internal)\n * - If from = 'RIC', applies [R, I, C] -> [I, C, R]\n *\n * @param state - Relative state in external frame\n * @param from - External frame: 'RIC' or 'LVLH'\n * @returns Relative state in internal ordering [x=I, y=C, z=R]\n */\nexport const toInternalFromFrame = (\n  state: RelativeState,\n  from: Frame\n): RelativeState => {\n  if (from === \"RIC\") {\n    // External order [R, I, C] -> Internal [x, y, z] = [I, C, R]\n    const [r, i, c] = state.position;\n    const [vr, vi, vc] = state.velocity;\n    const position: Vector3 = [i, c, r];\n    const velocity: Vector3 = [vi, vc, vr];\n    return { position, velocity };\n  }\n  // LVLH is already internal ordering [I, C, R]\n  return state;\n};\n\n/**\n * Convert a relative state from the module's internal LVLH ordering [x=I, y=C, z=R]\n * to an external local-orbital frame (RIC/LVLH).\n *\n * - If to = 'LVLH', this is identity (LVLH == internal)\n * - If to = 'RIC', applies [I, C, R] -> [R, I, C]\n *\n * @param state - Relative state in internal ordering [x=I, y=C, z=R]\n * @param to - External frame: 'RIC' or 'LVLH'\n * @returns Relative state in external frame ordering\n */\nexport const fromInternalToFrame = (\n  state: RelativeState,\n  to: Frame\n): RelativeState => {\n  if (to === \"RIC\") {\n    // Internal [x, y, z] = [I, C, R] -> External [R, I, C] = [z, x, y]\n    const [ix, iy, iz] = state.position; // ix=I, iy=C, iz=R\n    const [vix, viy, viz] = state.velocity;\n    const position: Vector3 = [iz, ix, iy];\n    const velocity: Vector3 = [viz, vix, viy];\n    return { position, velocity };\n  }\n  // LVLH is already internal ordering [I, C, R]\n  return state;\n};\n","/**\n * In-plane (X-Z) state transition matrix for the Yamanaka-Ankersen propagation.\n *\n * Reference: Yamanaka-Ankersen (2002), Eqs. (80)-(83).\n */\n\nimport type { InPlaneState, TrueAnomaly } from \"@/types\";\nimport { c, cPrime, rho, s, sPrime } from \"@/auxiliary-functions\";\n\n/**\n * Compute the pseudo-initial in-plane state used by the YA in-plane STM.\n *\n * Reference: Yamanaka-Ankersen (2002). Uses the inverse transformation matrix (Eq. (80))\n * to construct the pseudo-initial vector defined in Eq. (82), so that propagation by\n * Eq. (83) is affine-free.\n *\n * @param state - In-plane components (x, z, vx, vz) in modified coordinates\n * @param e - Eccentricity e in [0, 1)\n * @param theta0 - Initial true anomaly theta0 [rad]\n * @returns Pseudo-initial in-plane state\n */\nexport const computePseudoInitialInPlane = (\n  state: InPlaneState,\n  e: number,\n  theta0: TrueAnomaly\n): InPlaneState => {\n  const rho0 = rho(e, theta0);\n  const s0 = s(e, theta0);\n  const c0 = c(e, theta0);\n\n  const oneMinusE2 = 1 - e * e;\n  const factor = 1 / oneMinusE2;\n\n  const xBar =\n    factor *\n    ((1 - e * e) * state.x +\n      3 * e * (s0 / rho0) * (1 + 1 / rho0) * state.z +\n      -e * s0 * (1 + 1 / rho0) * state.vx +\n      (-e * c0 + 2) * state.vz);\n\n  const zBar =\n    factor *\n    (0 +\n      -3 * (s0 / rho0) * (1 + (e * e) / rho0) * state.z +\n      s0 * (1 + 1 / rho0) * state.vx +\n      (c0 - 2 * e) * state.vz);\n\n  const vxBar =\n    factor *\n    (0 +\n      -3 * (c0 / rho0 + e) * state.z +\n      (c0 * (1 + 1 / rho0) + e) * state.vx +\n      -s0 * state.vz);\n\n  const vzBar =\n    factor *\n    (0 +\n      (3 * rho0 + e * e - 1) * state.z +\n      -rho0 * rho0 * state.vx +\n      e * s0 * state.vz);\n\n  return { x: xBar, z: zBar, vx: vxBar, vz: vzBar };\n};\n\n/**\n * Propagate the in-plane (x-z) motion using the YA state transition matrix.\n *\n * Reference: Yamanaka-Ankersen (2002), Eq. (83). Uses auxiliary terms rho, s, c, s', c'\n * and J to evolve the pseudo-initial state to the final true anomaly.\n *\n * @param pseudoInitial - Pseudo-initial in-plane state (from Eq. (82))\n * @param e - Eccentricity e in [0, 1)\n * @param theta - Final true anomaly theta [rad]\n * @param JValue - J(theta) scalar (Eq. (47)), dimensionless\n * @returns Final in-plane state in modified coordinates\n */\nexport const propagateInPlane = (\n  pseudoInitial: InPlaneState,\n  e: number,\n  theta: TrueAnomaly,\n  JValue: number\n): InPlaneState => {\n  const rhoVal = rho(e, theta);\n  const sVal = s(e, theta);\n  const cVal = c(e, theta);\n  const sPrimeVal = sPrime(e, theta);\n  const cPrimeVal = cPrime(e, theta);\n\n  const oneOverRho = 1 / rhoVal;\n\n  const x =\n    1 * pseudoInitial.x +\n    -cVal * (1 + oneOverRho) * pseudoInitial.z +\n    sVal * (1 + oneOverRho) * pseudoInitial.vx +\n    3 * rhoVal * rhoVal * JValue * pseudoInitial.vz;\n\n  const z =\n    0 * pseudoInitial.x +\n    sVal * pseudoInitial.z +\n    cVal * pseudoInitial.vx +\n    (2 - 3 * e * sVal * JValue) * pseudoInitial.vz;\n\n  const vx =\n    0 * pseudoInitial.x +\n    2 * sVal * pseudoInitial.z +\n    (2 * cVal - e) * pseudoInitial.vx +\n    3 * (1 - 2 * e * sVal * JValue) * pseudoInitial.vz;\n\n  const vz =\n    0 * pseudoInitial.x +\n    sPrimeVal * pseudoInitial.z +\n    cPrimeVal * pseudoInitial.vx +\n    -3 * e * (sPrimeVal * JValue + sVal / (rhoVal * rhoVal)) * pseudoInitial.vz;\n\n  return { x, z, vx, vz };\n};\n","/**\n * Out-of-plane (Y) state transition for the Yamanaka-Ankersen propagation.\n *\n * Reference: Yamanaka-Ankersen (2002), Eq. (84).\n */\n\nimport type { OutOfPlaneState, TrueAnomaly } from \"@/types\";\nimport { rho } from \"@/auxiliary-functions\";\n\n/**\n * Propagate the out-of-plane (y) motion in modified coordinates.\n *\n * Reference: Yamanaka-Ankersen (2002), Eq. (84). The y-dynamics reduce to a\n * harmonic oscillator with a rotation in the (y, v_y) plane as theta advances.\n *\n * @param initial - Initial out-of-plane state (y, v_y) in modified coordinates\n * @param e - Eccentricity e in [0, 1)\n * @param theta0 - Initial true anomaly theta0 [rad]\n * @param theta - Final true anomaly theta [rad]\n * @returns Final out-of-plane state in modified coordinates\n */\nexport const propagateOutOfPlane = (\n  initial: OutOfPlaneState,\n  e: number,\n  theta0: TrueAnomaly,\n  theta: TrueAnomaly\n): OutOfPlaneState => {\n  const rho0 = rho(e, theta0);\n  const rhoT = rho(e, theta);\n\n  const deltaTheta = theta - theta0;\n  const cosDelta = Math.cos(deltaTheta);\n  const sinDelta = Math.sin(deltaTheta);\n\n  const factor = 1 / (rhoT / rho0);\n\n  const y = factor * (cosDelta * initial.y + sinDelta * initial.vy);\n  const vy = factor * (-sinDelta * initial.y + cosDelta * initial.vy);\n\n  return { y, vy };\n};\n","/**\n * Yamanaka-Ankersen State Transition Matrix for Relative Motion on Elliptical Orbits\n *\n * This implements the analytical solution from:\n * \"New State Transition Matrix for Relative Motion on an Arbitrary Elliptical Orbit\"\n * Journal of Guidance, Control, and Dynamics, Vol. 25, No. 1, January-February 2002\n */\n\nimport type {\n  Frame,\n  InPlaneState,\n  OrbitalElements,\n  OutOfPlaneState,\n  RelativeState,\n  TrueAnomaly,\n} from \"@/types\";\nimport { J } from \"@/auxiliary-functions\";\nimport {\n  fromModifiedCoordinates,\n  toModifiedCoordinates,\n} from \"@/coordinate-transforms\";\nimport { fromInternalToFrame, toInternalFromFrame } from \"@/frames\";\nimport { computePseudoInitialInPlane, propagateInPlane } from \"@/in-plane-stm\";\nimport { propagateOutOfPlane } from \"@/out-of-plane-stm\";\n\n/**\n * Propagate a relative state across an elliptic orbit using the Yamanaka-Ankersen STM.\n *\n * Algorithm outline (following the paper):\n * 1) Transform the true state to modified coordinates (YA modified variables)\n * 2) Compute the pseudo-initial in-plane state (Eq. (82))\n * 3) Propagate in-plane via Eq. (83) and out-of-plane via Eq. (84)\n * 4) Combine components and transform back to true coordinates\n *\n * Reference: Yamanaka-Ankersen (2002), Eqs. (47), (82)-(84) and accompanying text.\n *\n * @param initialState - Relative state in true coordinates; position [m], velocity [m/s]\n * @param elements - Orbital elements providing e, mu, h (e in [0,1))\n * @param theta0 - Initial true anomaly theta0 [rad]\n * @param thetaF - Final true anomaly theta [rad]\n * @param deltaTime - Time difference (t - t0) [s]\n * @param frame - Interpret input as [R, I, C] in this frame and return output in the same frame\n * @returns Final relative state at theta = thetaF in the provided frame\n * @throws Error if e not in [0, 1)\n */\nexport const propagateYA = (\n  initialState: RelativeState,\n  elements: OrbitalElements,\n  theta0: TrueAnomaly,\n  thetaF: TrueAnomaly,\n  deltaTime: number,\n  frame: Frame\n): RelativeState => {\n  const e = elements.eccentricity;\n\n  // Validate eccentricity\n  if (e < 0 || e >= 1) {\n    throw new Error(`Eccentricity must be in range [0, 1), got ${e}`);\n  }\n\n  // Map input frame to internal ordering if requested\n  const internalInitial = toInternalFromFrame(initialState, frame);\n\n  // Transform to modified coordinates at initial time\n  const modifiedInitial = toModifiedCoordinates(\n    internalInitial,\n    elements,\n    theta0\n  );\n\n  // Compute J value\n  const JValue = J(elements, deltaTime);\n\n  // Propagate in-plane motion\n  const inPlaneInitial: InPlaneState = {\n    x: modifiedInitial.position[0],\n    z: modifiedInitial.position[2],\n    vx: modifiedInitial.velocity[0],\n    vz: modifiedInitial.velocity[2],\n  };\n\n  const pseudoInPlane = computePseudoInitialInPlane(inPlaneInitial, e, theta0);\n  const finalInPlane = propagateInPlane(pseudoInPlane, e, thetaF, JValue);\n\n  // Propagate out-of-plane motion\n  const outOfPlaneInitial: OutOfPlaneState = {\n    y: modifiedInitial.position[1],\n    vy: modifiedInitial.velocity[1],\n  };\n\n  const finalOutOfPlane = propagateOutOfPlane(\n    outOfPlaneInitial,\n    e,\n    theta0,\n    thetaF\n  );\n\n  // Combine results in modified coordinates\n  const modifiedFinal: RelativeState = {\n    position: [finalInPlane.x, finalOutOfPlane.y, finalInPlane.z],\n    velocity: [finalInPlane.vx, finalOutOfPlane.vy, finalInPlane.vz],\n  };\n\n  // Transform back to true coordinates (internal ordering)\n  const finalTrueInternal = fromModifiedCoordinates(\n    modifiedFinal,\n    elements,\n    thetaF\n  );\n\n  return fromInternalToFrame(finalTrueInternal, frame);\n};\n","/**\n * Clohessy-Wiltshire (Hill-Clohessy-Wiltshire) propagation for circular orbits.\n *\n * Reference: The YA STM reduces to the CW solution in the circular limit. This\n * function provides a direct CW propagation for validation and comparison (cf.\n * Yamanaka-Ankersen (2002), discussion around the e -> 0 limit, e.g., Eq. (91)).\n */\n\nimport type { Frame, RelativeState } from \"@/types\";\nimport { fromInternalToFrame, toInternalFromFrame } from \"@/frames\";\n\n/**\n * Propagate using the classical Clohessy-Wiltshire (Hill's) equations for e = 0.\n *\n * Reference: The YA STM reduces to the CW solution in the circular limit. This\n * function provides a direct CW propagation for validation and comparison (cf.\n * Yamanaka-Ankersen (2002), discussion around the e -> 0 limit, e.g., Eq. (91)).\n *\n * @param initialState - Relative state in true coordinates; position [m], velocity [m/s]\n * @param orbitalRate - Mean motion n for the circular reference orbit [rad/s]\n * @param deltaTime - Time difference (t - t0) [s]\n * @param frame - Interpret input as [R, I, C] in this frame and return output in the same frame\n * @returns Final relative state under CW dynamics in the provided frame\n */\nexport const propagateHCW = (\n  initialState: RelativeState,\n  orbitalRate: number,\n  deltaTime: number,\n  frame: Frame\n): RelativeState => {\n  // Map input frame to internal LVLH ordering\n  const internalInitial = toInternalFromFrame(initialState, frame);\n\n  const n = orbitalRate;\n  const dt = deltaTime;\n  const nt = n * dt;\n\n  const sinNt = Math.sin(nt);\n  const cosNt = Math.cos(nt);\n\n  const [x0, y0, z0] = internalInitial.position;\n  const [vx0, vy0, vz0] = internalInitial.velocity;\n\n  const x =\n    x0 +\n    6 * (nt - sinNt) * z0 +\n    (1 / n) * (4 * sinNt - 3 * nt) * vx0 +\n    (2 / n) * (1 - cosNt) * vz0;\n  const z =\n    (4 - 3 * cosNt) * z0 + (2 / n) * (cosNt - 1) * vx0 + (1 / n) * sinNt * vz0;\n\n  const vx = 6 * n * (1 - cosNt) * z0 + (4 * cosNt - 3) * vx0 + 2 * sinNt * vz0;\n  const vz = 3 * n * sinNt * z0 + -2 * sinNt * vx0 + cosNt * vz0;\n\n  const y = cosNt * y0 + (1 / n) * sinNt * vy0;\n  const vy = -n * sinNt * y0 + cosNt * vy0;\n\n  const internalFinal: RelativeState = {\n    position: [x, y, z],\n    velocity: [vx, vy, vz],\n  };\n\n  return fromInternalToFrame(internalFinal, frame);\n};\n","/**\n * Keplerian orbital mechanics utilities.\n *\n * Note: These helpers are not from Yamanaka-Ankersen; they are provided for convenience\n * when applying the YA STM over time by converting between anomalies and computing orbital periods.\n */\n\nimport type {\n  OrbitalElements,\n  TrueAnomaly,\n  DeriveAngularMomentum,\n} from \"@/types\";\n\n/**\n * Solve Kepler's equation to obtain true anomaly from mean anomaly.\n *\n * Note: This helper is not from Yamanaka-Ankersen; it is provided for convenience\n * when applying the YA STM over time by converting between anomalies.\n *\n * @param meanAnomaly - Mean anomaly M [rad]\n * @param eccentricity - Eccentricity e in [0, 1)\n * @param tolerance - Convergence tolerance on E (default 1e-10)\n * @returns True anomaly theta corresponding to M [rad]\n */\nexport const trueAnomalyFromMean = (\n  meanAnomaly: number,\n  eccentricity: number,\n  tolerance: number = 1e-10\n): TrueAnomaly => {\n  // First solve Kepler's equation for eccentric anomaly\n  let E = meanAnomaly; // Initial guess\n\n  for (let i = 0; i < 100; i++) {\n    const f = E - eccentricity * Math.sin(E) - meanAnomaly;\n    const fPrime = 1 - eccentricity * Math.cos(E);\n    const deltaE = f / fPrime;\n    E -= deltaE;\n\n    if (Math.abs(deltaE) < tolerance) break;\n  }\n\n  // Convert eccentric anomaly to true anomaly\n  const theta =\n    2 *\n    Math.atan(\n      Math.sqrt((1 + eccentricity) / (1 - eccentricity)) * Math.tan(E / 2)\n    );\n\n  return theta;\n};\n\n/**\n * Compute true anomaly at time t0 + dt given theta0 via Kepler propagation.\n *\n * Note: This helper is not from Yamanaka-Ankersen; it is provided for convenience\n * to advance theta when using the YA STM.\n *\n * @param elements - Orbital elements providing e, mu, h\n * @param theta0 - Initial true anomaly theta0 [rad]\n * @param deltaTime - Time difference dt [s]\n * @returns True anomaly theta at t0 + dt [rad]\n */\nexport const trueAnomalyAtTime = (\n  elements: OrbitalElements,\n  theta0: TrueAnomaly,\n  deltaTime: number\n): TrueAnomaly => {\n  const {\n    eccentricity: e,\n    angularMomentum: h,\n    gravitationalParameter: mu,\n  } = elements;\n\n  // Compute semi-major axis\n  const a = (h * h) / (mu * (1 - e * e));\n\n  // Mean motion\n  const n = Math.sqrt(mu / (a * a * a));\n\n  // Convert initial true anomaly to eccentric anomaly\n  const E0 = 2 * Math.atan(Math.sqrt((1 - e) / (1 + e)) * Math.tan(theta0 / 2));\n\n  // Initial mean anomaly\n  const M0 = E0 - e * Math.sin(E0);\n\n  // Mean anomaly at final time\n  const Mf = M0 + n * deltaTime;\n\n  // Solve for final true anomaly\n  return trueAnomalyFromMean(Mf, e);\n};\n\n/**\n * Compute the orbital period for the given elements.\n *\n * Note: This helper is not from Yamanaka-Ankersen; it is provided for convenience\n * when planning propagation intervals.\n *\n * @param elements - Orbital elements providing e, mu, h\n * @returns Orbital period T [s]\n */\nexport const orbitalPeriod = (elements: OrbitalElements): number => {\n  const {\n    angularMomentum: h,\n    gravitationalParameter: mu,\n    eccentricity: e,\n  } = elements;\n  const a = (h * h) / (mu * (1 - e * e)); // Semi-major axis\n  return 2 * Math.PI * Math.sqrt((a * a * a) / mu);\n};\n\n/**\n * Derive specific angular momentum from TLE mean motion and eccentricity.\n *\n * Note: This helper is not from Yamanaka-Ankersen; it is provided for convenience\n * when constructing OrbitalElements from TLE data. TLE mean motion is an SGP4 \"mean\" value\n * (J2-perturbed). This closed-form conversion is suitable for Keplerian helpers and quick\n * estimates. For high-precision propagation directly from TLEs, prefer an SGP4 implementation.\n *\n * @param eccentricity - Eccentricity e in [0, 1) from TLE ECCENTRICITY\n * @param meanMotionRevPerDay - Mean motion n in rev/day from TLE MEAN_MOTION\n * @param mu - Gravitational parameter in m^3/s^2 (e.g., 3.986004418e14 for Earth)\n * @returns Specific angular momentum h [m^2/s]\n */\nexport const deriveAngularMomentum: DeriveAngularMomentum = (\n  eccentricity: number,\n  meanMotionRevPerDay: number,\n  mu: number\n): number => {\n  if (!(eccentricity >= 0 && eccentricity < 1)) {\n    throw new Error(\"eccentricity must be in [0,1).\");\n  }\n  if (!(meanMotionRevPerDay > 0)) {\n    throw new Error(\"meanMotionRevPerDay must be > 0.\");\n  }\n\n  const nRadPerSec = (meanMotionRevPerDay * 2 * Math.PI) / 86400; // rad/s\n  const a = Math.cbrt(mu / (nRadPerSec * nRadPerSec)); // m\n  return Math.sqrt(mu * a * (1 - eccentricity * eccentricity)); // m^2/s\n};\n"]}