sun_position_from_body
Defined in: ephemeris.rs:285
fn sun_position_from_body(body: KnownBody, epoch: &[Epoch<Tdb>](../../structs/epoch/)) -> [Result<[Vec3<frame::Gcrs>](../../structs/vec3/), SunPositionError>](https://doc.rust-lang.org/std/result/enum.Result.html)
Sun position vector as seen from body, in the J2000 equatorial frame [km].
The vector points from the body toward the Sun — what a third-body term and a cannonball SRP model both need. Fails rather than substituting Earth’s, because a wrong central body is not a small error: from Mars in 2026 the geocentric Sun direction is up to 176° away from the true one, and the distance ratio scales the third-body term by up to 3.8x.
The Moon’s vector carries lunar parallax: Moon-to-Sun is
(Earth → Sun) − (Earth → Moon), and both terms are already available (as
exact as those two analytical series are, which is ~1′ here). The &str
helper shares Earth’s vector for the Moon instead, dropping a parallax of
up to 0.15° — nine times that ~1′ — so there is no reason to keep it where
the Moon position is one subtraction away.