Class EllipticalFieldOfView

  • All Implemented Interfaces:
    FieldOfView

    public class EllipticalFieldOfView
    extends SmoothFieldOfView
    Class representing a spacecraft sensor Field Of View with elliptical shape.

    Without loss of generality, one can assume that with a suitable rotation the ellipse center is along the Zell axis and the ellipse principal axes are along the Xell and Yell axes. The first defining elements for an ellipse are these canonical axes. This class allows specifying them by giving directly the Zell axis as the center of the ellipse, and giving a primaryMeridian vector in the (+Xell, Zell) half-plane. It is allowed to have primaryMeridian not orthogonal to center as orthogonality will be fixed internally (i.e primaryMeridian may be different from Xell).

    We can define angular coordinates \((\alpha, \beta)\) as dihedra angles around the +Yell and -Xell axes respectively to specify points on the unit sphere. The corresponding Cartesian coordinates will be \[P_{\alpha,\beta}\left(\begin{gather*} \frac{\sin\alpha\cos\beta}{\sqrt{1-\sin^2\alpha\sin^2\beta}}\\ \frac{\cos\alpha\sin\beta}{\sqrt{1-\sin^2\alpha\sin^2\beta}}\\ \frac{\cos\alpha\cos\beta}{\sqrt{1-\sin^2\alpha\sin^2\beta}} \end{gather*}\right)\] which shows that angle \(\beta=0\) corresponds to the (Xell, Zell) plane and that angle \(\alpha=0\) corresponds to the (Yell, Zell) plane. Note that at least one of the angles must be different from \(\pm\frac{\pi}{2}\), which means that the expression above is singular for points in the (Xell, Yell) plane.

    The size of the ellipse is defined by its half aperture angles \(\lambda\) along the Xell axis and \(\mu\) along the Yell axis. For points belonging to the ellipse, we always have \(-\lambda \le \alpha \le +\lambda\) and \(-\mu \le \beta \le +\mu\), equalities being reached at the end of principal axes. An ellipse defined on the sphere is not a planar ellipse because the four endpoints \((\alpha=\pm\lambda, \beta=0)\) and \((\alpha=0, \beta=\pm\mu)\) are not coplanar when \(\lambda\neq\mu\).

    We define an ellipse on the sphere as the locus of points \(P\) such that the sum of their angular distance to two foci \(F_+\) and \(F_-\) is constant, all points being on the sphere. The relationship between the foci and the two half aperture angles \(\lambda\) and \(\mu\) is: \[\lambda \ge \mu \Rightarrow F_\pm\left(\begin{gather*} \pm\sin\delta\\ 0\\ \cos\delta \end{gather*}\right) \quad\text{with}\quad \cos\delta = \frac{\cos\lambda}{\cos\mu}\]

    and \[\mu \ge \lambda \Rightarrow F_\pm\left(\begin{gather*} 0\\ \pm\sin\delta\\ \cos\delta \end{gather*}\right) \quad\text{with}\quad \cos\delta = \frac{\cos\mu}{\cos\lambda}\]

    It can be shown that the previous definition is equivalent to define first a regular planar ellipse drawn on a plane \(z = z_0\) (\(z_0\) being an arbitrary strictly positive number, \(z_0=1\) being the simplest choice) with semi major axis \(a=z_0\tan\lambda\) and semi minor axis \(b=z_0\tan\mu\) and then to project it onto the sphere using a central projection: \[\left\{\begin{align*} \left(\frac{x}{z_0\tan\lambda}\right)^2 + \left(\frac{y}{z_0\tan\mu}\right)^2 &= \left(\frac{z}{z_0}\right)^2\\ x^2 + y^2 + z^2 &= 1 \end{align*}\right.\]

    Simplifying first equation by \(z_0\) and eliminating \(z^2\) in it using the second equation gives: \[\left\{\begin{align*} \left(\frac{x}{\sin\lambda}\right)^2 + \left(\frac{y}{\sin\mu}\right)^2 &= 1\\ x^2 + y^2 + z^2 &= 1 \end{align*}\right.\] which shows that the previous definition is also equivalent to define first a dimensionless planar ellipse on the \((x, y)\) plane and to project it onto the sphere using a projection along \(z\).

    Note however that despite the ellipse on the sphere can be computed as a projection of an ellipse on the \((x, y)\) plane, the foci of one ellipse are not the projection of the foci of the other ellipse. The foci on the plane are closer to each other by a factor \(\cos\mu\) than the projection of the foci \(F_+\) and \(F_-\)).

    Since:
    10.1
    Author:
    Luc Maisonobe
    • Constructor Detail

      • EllipticalFieldOfView

        public EllipticalFieldOfView​(Vector3D center,
                                     Vector3D primaryMeridian,
                                     double halfApertureAlongX,
                                     double halfApertureAlongY,
                                     double margin)
        Build a new instance.

        Using a suitable rotation, an elliptical Field Of View can be oriented such that the ellipse center is along the Zell axis, one of its principal axes is in the (Xell, Zell) plane and the other principal axis is in the (Yell, Zell) plane. Beware that the ellipse principal axis that spreads along the Yell direction corresponds to a rotation around -Xell axis and that the ellipse principal axis that spreads along the Xell direction corresponds to a rotation around +Yell axis. The naming convention used here is that the angles are named after the spreading axis.

        Parameters:
        center - direction of the FOV center (i.e. Zell), in spacecraft frame
        primaryMeridian - vector defining the (+Xell, Zell) half-plane (it is allowed to have primaryMeridian not orthogonal to center as orthogonality will be fixed internally)
        halfApertureAlongX - FOV half aperture angle defining the ellipse spreading along Xell (i.e. it corresponds to a rotation around +Yell)
        halfApertureAlongY - FOV half aperture angle defining the ellipse spreading along Yell (i.e. it corresponds to a rotation around -Xell)
        margin - angular margin to apply to the zone (if positive, the Field Of View will consider points slightly outside of the zone are still visible)
    • Method Detail

      • getHalfApertureAlongX

        public double getHalfApertureAlongX()
        get the FOV half aperture angle for spreading along Xell (i.e. rotation around +Yell).
        Returns:
        FOV half aperture angle for spreading along Xell (i.e. rotation around +Yell
      • getHalfApertureAlongY

        public double getHalfApertureAlongY()
        get the FOV half aperture angle for spreading along Yell (i.e. rotation around -Xell).
        Returns:
        FOV half aperture angle for spreading along Yell (i.e. rotation around -Xell)
      • getFocus1

        public Vector3D getFocus1()
        Get first focus in spacecraft frame.
        Returns:
        first focus in spacecraft frame
      • getFocus2

        public Vector3D getFocus2()
        Get second focus in spacecraft frame.
        Returns:
        second focus in spacecraft frame
      • offsetFromBoundary

        public double offsetFromBoundary​(Vector3D lineOfSight,
                                         double angularRadius,
                                         VisibilityTrigger trigger)
        Get the offset of target body with respect to the Field Of View Boundary.

        The offset is the signed angular distance between target body and closest boundary point, taking into account VisibilityTrigger and margin.

        As Field Of View can have complex shapes that may require long computation, when the target point can be proven to be outside of the Field Of View, a faster but approximate computation can be used. This approximation is only performed about 0.01 radians outside of the Field Of View augmented by the deadband defined by target body radius and Field Of View margin and should be designed to still return a positive value if the full accurate computation would return a positive value. When target point is close to the zone (and furthermore when it is inside the zone), the full accurate computation is performed. This design allows this offset to be used as a reliable way to detect Field Of View boundary crossings (taking VisibilityTrigger and margin into account), which correspond to sign changes of the offset.

        Parameters:
        lineOfSight - line of sight from the center of the Field Of View support unit sphere to the target in spacecraft frame
        angularRadius - target body angular radius
        trigger - visibility trigger for spherical bodies
        Returns:
        an offset negative if the target is visible within the Field Of View and positive if it is outside of the Field Of View (note that this cannot take into account interposing bodies)
        See Also:
        FieldOfView.offsetFromBoundary(Vector3D, double, VisibilityTrigger)
      • projectToBoundary

        public Vector3D projectToBoundary​(Vector3D lineOfSight)
        Find the direction on Field Of View Boundary closest to a line of sight.
        Parameters:
        lineOfSight - line of sight from the center of the Field Of View support unit sphere to the target in spacecraft frame
        Returns:
        direction on Field Of View Boundary closest to a line of sight
      • directionAt

        protected Vector3D directionAt​(double angle)
        Get boundary direction at angle.
        Specified by:
        directionAt in class SmoothFieldOfView
        Parameters:
        angle - phase angle of the boundary direction
        Returns:
        boundary direction at phase angle in spacecraft frame