getPosition static method

Map<String, num> getPosition(
  1. DateTime date,
  2. num lat,
  3. num lng
)

Implementation

static Map<String, num> getPosition(DateTime date, num lat, num lng) {
  var lw = rad * -lng;
  var phi = rad * lat;
  var d = toDays(date);

  var c = sunCoords(d);
  var H = siderealTime(d, lw) - (c["ra"] ?? 0.0);

  return {
    "azimuth": azimuth(H, phi, (c["dec"] ?? 0.0)),
    "altitude": altitude(H, phi, (c["dec"] ?? 0.0))
  };
}