lib/lune.js
function kepler (m, ecc) {
  const epsilon = 1e-6

  m = torad(m)
  let e = m
  while (1) {
    const delta = e - ecc * Math.sin(e) - m
    e -= delta / (1.0 - ecc * Math.cos(e))

    if (Math.abs(delta) <= epsilon) {
      break
    }
  }

  return e
}
function kepler (m, ecc) {
  const epsilon = 1e-6

  m = torad(m)
  let e = m
  while (1) {
    const delta = e - ecc * Math.sin(e) - m
    e -= delta / (1.0 - ecc * Math.cos(e))

    if (Math.abs(delta) <= epsilon) {
      break
    }
  }

  return e
}
function kepler ( m , ecc ) { const epsilon = 1e-6 m = torad ( m ) let e = m while ( 1 ) { const delta = e - ecc * Math . sin ( e ) - m e -= delta / ( 1.0 - ecc * Math . cos ( e ) ) if ( Math . abs ( delta ) <= epsilon ) { break } } return e }
Solve the equation of Kepler.
Solve the equation of Kepler .