sunPosition method

Map<String, double> sunPosition(
  1. double jd
)

Implementation

Map<String, double> sunPosition(double jd) {
  final double D = jd - 2451545.0;
  final double g = fixangle(357.529 + 0.98560028 * D);
  final double q = fixangle(280.459 + 0.98564736 * D);
  final double L = fixangle(q + 1.915 * dsin(g) + 0.020 * dsin(2 * g));
  // final double R = 1.00014 - 0.01671 * dcos(g) - 0.00014 * dcos(2 * g);
  final double e = 23.439 - 0.00000036 * D;
  final double d = darcsin(dsin(e) * dsin(L));
  double RA = darctan2(dcos(e) * dsin(L), dcos(L)) / 15;
  RA = fixhour(RA);
  final double EqT = q / 15 - RA;
  return {"declination": d, "equation": EqT};
}