Class WaypointPVBuilder


  • public class WaypointPVBuilder
    extends Object
    Builder class, enabling incremental building of an PVCoordinatesProvider instance using waypoints defined on an ellipsoid. Given a series of waypoints ((date, point) tuples), build a PVCoordinatesProvider representing the path. The static methods provide implementations for the most common path definitions (cartesian, great-circle, loxodrome). If these methods are insufficient, the public constructor provides a way to customize the path definition. This class connects the path segments using the AggregatedPVCoordinatesProvider. As such, no effort is made to smooth the velocity between segments. While position is unaffected, the velocity may be discontinuous between adjacent time points. Thus, care should be taken when modeling paths with abrupt direction changes (e.g. fast-moving aircraft); understand how the PVCoordinatesProvider will be used in the particular application.
    Since:
    11.3
    Author:
    Joe Reed
    • Constructor Detail

      • WaypointPVBuilder

        public WaypointPVBuilder​(WaypointPVBuilder.InterpolationFactory factory,
                                 OneAxisEllipsoid body)
        Create a new instance.
        Parameters:
        factory - The factory used to create the intermediate coordinate providers between waypoints.
        body - The central body, on which the way points are defined.
    • Method Detail

      • cartesianBuilder

        public static WaypointPVBuilder cartesianBuilder​(OneAxisEllipsoid body)
        Construct a waypoint builder interpolating points using a linear cartesian interpolation.
        Parameters:
        body - the reference ellipsoid on which the waypoints are defined.
        Returns:
        the waypoint builder
      • loxodromeBuilder

        public static WaypointPVBuilder loxodromeBuilder​(OneAxisEllipsoid body)
        Construct a waypoint builder interpolating points using a loxodrome (or Rhumbline).
        Parameters:
        body - the reference ellipsoid on which the waypoints are defined.
        Returns:
        the waypoint builder
      • greatCircleBuilder

        public static WaypointPVBuilder greatCircleBuilder​(OneAxisEllipsoid body)
        Construct a waypoint builder interpolating points using a great-circle. The altitude of the intermediate points is linearly interpolated from the bounding waypoints. Extrapolating before the first waypoint or after the last waypoint may result in undefined altitudes.
        Parameters:
        body - the reference ellipsoid on which the waypoints are defined.
        Returns:
        the waypoint builder
      • constantBefore

        public WaypointPVBuilder constantBefore()
        Indicate the resulting PVCoordinatesProvider provide a constant location of the first waypoint prior to the first time.
        Returns:
        this instance
      • constantAfter

        public WaypointPVBuilder constantAfter()
        Indicate the resulting PVCoordinatesProvider provide a constant location of the last waypoint after to the last time.
        Returns:
        this instance
      • createInitial

        protected PVCoordinatesProvider createInitial​(AbsoluteDate firstDate,
                                                      GeodeticPoint firstPoint)
        Create the initial provider. This method uses the internal validBefore flag to either return an invalid PVCoordinatesProvider or a constant one.
        Parameters:
        firstDate - the date at which the first waypoint is reached and this provider will no longer be called
        firstPoint - the first waypoint
        Returns:
        the coordinate provider
      • createFinal

        protected PVCoordinatesProvider createFinal​(AbsoluteDate lastDate,
                                                    GeodeticPoint lastPoint)
        Create the final provider. This method uses the internal validAfter flag to either return an invalid PVCoordinatesProvider or a constant one.
        Parameters:
        lastDate - the date at which the last waypoint is reached and this provider will be called
        lastPoint - the last waypoint
        Returns:
        the coordinate provider