barycentricScaled method
- double jdTDB
Direction to the star from the solar system barycentre at jdTDB,
scaled by parallax: the vector r/d₀ (d₀ – distance at the catalogue
epoch), in the ICRS.
Space motion is linear: r(t) = r₀ + v·(t − t₀), where v combines the proper motion (perpendicular to the direction) and the radial velocity (along it). After dividing by d₀ zero parallax is not a special case – the radial velocity then drops out of the direction and the proper motion remains.
Implementation
Vector3 barycentricScaled(double jdTDB) {
final a = rightAscension * math.pi / 180;
final d = declination * math.pi / 180;
final (sa, ca, sd, cd) = (
math.sin(a),
math.cos(a),
math.sin(d),
math.cos(d),
);
final u = Vector3(cd * ca, cd * sa, sd);
final p = Vector3(-sa, ca, 0);
final q = Vector3(-sd * ca, -sd * sa, cd);
// Prędkość radialna jako zmiana odległości względnej na rok:
// vr / d₀ = vr · ϖ / AU (ϖ w radianach).
final radial =
radialVelocity *
86400 *
daysPerJulianYear /
astronomicalUnit *
_parallaxRadians;
final years = (jdTDB - j2000) / daysPerJulianYear;
return u +
(p * (properMotionRa * _mas) +
q * (properMotionDec * _mas) +
u * radial) *
years;
}