eclToEq function
Converts ecliptic (λ, β) to equatorial (α, δ) coordinates.
lon is ecliptic longitude, lat is ecliptic latitude (radians).
sEps, cEps are sine/cosine of obliquity.
Implementation
({double ra, double dec}) eclToEq(
double lon, double lat, double sEps, double cEps) {
final sLon = math.sin(lon);
final cLon = math.cos(lon);
final sLat = math.sin(lat);
final cLat = math.cos(lat);
return (
ra: mod2pi(math.atan2(sLon * cEps - (sLat / cLat) * sEps, cLon)),
dec: math.asin(sLat * cEps + cLat * sEps * sLon),
);
}