<< CL_gm_eclipse Geometry and events CL_gm_eclipseCir >>

CelestLab >> Geometry and events > CL_gm_eclipseCheck

CL_gm_eclipseCheck

Hidden fraction of a body (eclipsed by another body), as seen from an observer

Calling Sequence

[rat_ecl] = CL_gm_eclipseCheck(pos_obs, pos1, pos2, sr1, sr2)

Description

Parameters

pos_obs:

Position of observer (3xN or 3x1)

pos1:

Position of centre of sphere1 (3xN or 3x1)

pos2:

Position of centre of sphere2 (3xN or 3x1)

sr1:

Radius of sphere1 (1x1 or 1xN)

sr2:

Radius of sphere2 (1x1 or 1xN)

rat_ecl:

Hidden fraction of body1, as seen from pos_obs (3xN)

Authors

See also

Examples

// Fraction of Sun eclipsed by Earth (from an observer in space):
theta = linspace(165*%CL_deg2rad, 175*%CL_deg2rad, 100);
pos_obs = 42000.e3 * [ cos(theta) ; sin(theta) ; zeros(theta) ];
pos1 = %CL_au * [ 1 ; 0 ; 0 ]; // Sun
sr1 = %CL_radiusSun;
pos2 = [0 ; 0 ; 0]; // Earth
sr2 = %CL_eqRad;
rat_ecl = CL_gm_eclipseCheck(pos_obs, pos1, pos2, sr1, sr2);
scf();
plot(theta*%CL_rad2deg, rat_ecl, "o");
<< CL_gm_eclipse Geometry and events CL_gm_eclipseCir >>