Hacker News new | ask | show | jobs
by librasteve 382 days ago
made a PR for raku, hope it gets accepted

some cool things stood out:

  sub fixangle($a) { $a mod 360 }    # raku has built-in support for Euclidean modulo
  pi                                 # raku has pi
  
  # Solve equation of Kepler
  my $e = $M; 
  my $delta;

  repeat {                           # raku's repeat loop allows initialisation of delta to be folded in
    $delta = $e - $eccent * sin($e) - $M; 
    $e -= $delta / (1 - $eccent * cos($e));
  } while abs($delta) > 1e-6;
2 comments

Thanks! (I'm a big fan of Raku; it doesn't get nearly the respect it deserves!)
Thank you! I accepted it
yay - it has made it to raku module status https://raku.land/zef:librasteve/Moonphase