<< CL_gm_raan2beta Geometry and events CL_gm_sphericDist >>

CelestLab >> Geometry and events > CL_gm_reflectionPtSph

CL_gm_reflectionPtSph

Reflection point on a sphere

Calling Sequence

[posr,incid] = CL_gm_reflectionPtSph(pos1,pos2,srad,pos2_inf);

Description

Parameters

pos1:

Position of object 1 in cartesian coordinates (3xN or 3x1)

pos2:

Position of object 2 in cartesian coordinates (relative to the same frame as object 1) (3xN or 3x1)

srad:

Sphere radius (1xN or 1x1)

pos2_inf:

(optional, boolean) Computation option: %t if object 2 is considered to be at infinity, %f otherwise. Default is %f

posr:

Position of reflection point (3xN)

incid:

Incidence at reflection point. NB: can be more than 90 degrees (1xN)

Authors

Examples

// Example 1: simple case
alpha = linspace(-%pi/2, %pi/2, 11);
pos1 = 2 * [1;0;0];
pos2 = 2 * [cos(alpha); sin(alpha); zeros(alpha)];
[posr, incid] = CL_gm_reflectionPtSph(pos1, pos2, 1);
theta1 = CL_vectAngle(pos1*ones(alpha)-posr, posr);
theta2 = CL_vectAngle(pos2-posr, posr);
disp(theta2 - theta1); // should be 0
disp(theta1 - incid);  // should be 0

// Example 2: Sun glint
// Satellite's positions in inertial frame:
kep0 = [ %CL_eqRad+700.e3; 0; 1.1; 0; 0.8; 0 ];
t0 = CL_dat_cal2cjd(2000,3,21);
t = linspace(t0,t0+0.1,200);
kep = CL_ex_secularJ2(t0, kep0, t);
pos_sat = CL_oe_kep2car(kep);

// Sun's positions in inertial frame:
[r_sun,rs] = CL_mod_moonSunG50(t,'s');
pos_sun = CL_dMult(rs,r_sun);

// Position of Sun reflection point in same frame:
[pos_glint, incid] = CL_gm_reflectionPtSph(pos_sat,pos_sun,%CL_eqRad);
I = find(incid >= %pi/2);
pos_glint(:,I) = %nan;
scf();
CL_plot_ephem(pos_sat, color_id=2);
CL_plot_ephem(pos_glint, color_id=5);
CL_plot_ephem(pos_sun, color_id=-1);
<< CL_gm_raan2beta Geometry and events CL_gm_sphericDist >>