surf_pos_of_ray_first_intersection#
- Ellipsoid.surf_pos_of_ray_first_intersection(self, r_source: ndarray[double], u_ray: ndarray[double]) ndarray[double]#
Compute the first ellipsoid‐surface intersection of a ray.
Given a ray starting at ECEF point \(\mathbf{r}_0\) and traveling in unit‐direction \(\hat{\mathbf{u}}\), find the closest intersection point(s) with the reference ellipsoid surface.
- Parameters:
- r_sourcefloat or ndarray of float, shape (3,)
Ray origin in ECEF coordinates [\(x\), \(y\), \(z\)] (metres).
- u_rayndarray of float, shape (3,) or (N, 3)
Unit direction vector(s) of the ray in ECEF coordinates.
- Returns:
- r_surfndarray of float, shape (3,) or (N, 3)
ECEF coordinate(s) of the first intersection point(s) on the ellipsoid.
- Raises:
- AssertionError
If r_source is not shape (3,), or if u_ray is not shape (3,) or (N, 3).
See also
c_surf_pos_of_ray_first_intersectionCore C implementation (nogil) for a single ray.
Notes
Solve for the parameter \(t\) in the quadratic
\[\]- rac{igl(r_{0,x} + t,u_xigr)^2}{a^2}
- rac{igl(r_{0,y} + t,u_yigr)^2}{a^2}
- rac{igl(r_{0,z} + t,u_zigr)^2}{b^2}
= 1,
where \(a\) is the semi-major axis, \(b = a\,(1 - f)\) the semi-minor axis, and the smallest positive root is chosen. The intersection is then \(\mathbf{r}_ ext{surf} = \mathbf{r}_0 + t\,\hat{\mathbf{u}}\).