<< CL_gm_inters3dConesSa Geometry and events CL_gm_intersectCoplanOrb >>

CelestLab >> Geometry and events > CL_gm_inters3dLineEllips

CL_gm_inters3dLineEllips

Intersection of a half-ray with an ellipsoid.

Calling Sequence

[psol1,psol2,numsol] = CL_gm_inters3dLineEllips(pos,u [,posc,er,obla])

Description

Parameters

pos:

Origin of the half-ray (3xN or 3x1)

u:

Direction of the half-ray (not necessarily a unit vector) (3xN or 3x1)

posc:

(optional) Position of the centre of the ellipsoid. Default is [0;0;0]. (3x1)

er:

(optional) Ellipsoid equatorial radius [m]. Default is %CL_eqRad. (1x1)

obla:

(optional) Ellipsoid oblateness. Default is %CL_obla. (1x1)

psol1:

First solution, %nan*[1;1;1] if there is no intersection. (3xN)

psol2:

Second solution, %nan*[1;1;1] if there are less than 2 intersections. (3xN)

numsol:

Number of solutions for convenience: 0,1 or 2 (1xN)

Authors

Examples

// Intersection of line of sight with Earth
pos = [ 10000 ; 100 ; 500 ] * 1000; // origin, meters
u = [ -1 ; 0.2 ; 0.6]; // direction of line of sight
[psol1] = CL_gm_inters3dLineEllips(pos,u);
// Check results :
CL_co_car2ell(psol1) // => third coordinate (altitude) == 0
CL_vectAngle(u, psol1-pos) // => 0

Report an issue
<< CL_gm_inters3dConesSa Geometry and events CL_gm_intersectCoplanOrb >>