<< CL_gm_eclipse Geometry and events CL_gm_eclipseCir >>

CelestLab >> Geometry and events > CL_gm_eclipseCheck

CL_gm_eclipseCheck

Characteristic eclipse quantities

Calling Sequence

ratio = CL_gm_eclipseCheck(pos_obs, pos1 [, pos2, sr1, sr2])
[val1, val2, ...] = CL_gm_eclipseCheck(pos_obs, pos1, [, pos2, sr1, sr2, res]); with res = [name1, name2, ...]

Description

Parameters

pos_obs:

Position of observer [m] (3xN or 3x1)

pos1:

Position of body1 (= potentially eclipsed body) [m] (3xN or 3x1)

pos2:

(optional) Position of body2 (= occulting body) [m]. Default is [0;0;0] (3xN or 3x1)

sr1:

(optional) Radius of body1 (sphere) [m]. Default is %CL_body.Sun.eqRad (1x1)

sr2:

(optional) Radius of body2 (sphere) [m]. Default is %CL_eqRad (1x1)

res:

(string, optional) Names of computed quantities: "eclrat", "angu", "angp", "angc". Default is "eclrat" (1xP)

val1, val2...:

Computed quantities [rad or -] (1xN)

Authors

See also

Examples

// Eclipse of the Sun by Earth from an observer in space:
theta = linspace(2.88, 3.05, 1000);
pos_sat = 42164.e3 * [cos(theta); sin(theta); zeros(theta)];
au = CL_dataGet("au");
pos_sun = au * [1; 0; 0]; // Sun
eclrat = CL_gm_eclipseCheck(pos_sat, pos_sun);
angp = CL_gm_eclipseCheck(pos_sat, pos_sun, res="angp");
angu = CL_gm_eclipseCheck(pos_sat, pos_sun, res="angu");

// Plot the results
scf();
plot(theta*180/%pi, eclrat, "k");
plot(theta*180/%pi, angp, "r");
plot(theta*180/%pi, angu+1, "b");
CL_g_legend(gca(), ["eclrat", "angp", "angu + 1"]);

Report an issue
<< CL_gm_eclipse Geometry and events CL_gm_eclipseCir >>