Package org.orekit.utils
Class WaypointPVBuilder
- java.lang.Object
-
- org.orekit.utils.WaypointPVBuilder
-
public class WaypointPVBuilder extends Object
Builder class, enabling incremental building of anPVCoordinatesProviderinstance using waypoints defined on an ellipsoid. Given a series of waypoints ((date, point)tuples), build aPVCoordinatesProviderrepresenting 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 theAggregatedPVCoordinatesProvider. 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 thePVCoordinatesProviderwill be used in the particular application.- Since:
- 11.3
- Author:
- Joe Reed
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceWaypointPVBuilder.InterpolationFactoryFactory interface, creating thePVCoordinatesProviderinstances between the provided waypoints.
-
Constructor Summary
Constructors Constructor Description WaypointPVBuilder(WaypointPVBuilder.InterpolationFactory factory, OneAxisEllipsoid body)Create a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description WaypointPVBuilderaddWaypoint(GeodeticPoint point, AbsoluteDate date)Add a waypoint.PVCoordinatesProviderbuild()Build aPVCoordinatesProviderfrom the waypoints added to this builder.static WaypointPVBuildercartesianBuilder(OneAxisEllipsoid body)Construct a waypoint builder interpolating points using a linear cartesian interpolation.WaypointPVBuilderconstantAfter()Indicate the resultingPVCoordinatesProviderprovide a constant location of the last waypoint after to the last time.WaypointPVBuilderconstantBefore()Indicate the resultingPVCoordinatesProviderprovide a constant location of the first waypoint prior to the first time.protected PVCoordinatesProvidercreateFinal(AbsoluteDate lastDate, GeodeticPoint lastPoint)Create the final provider.protected PVCoordinatesProvidercreateInitial(AbsoluteDate firstDate, GeodeticPoint firstPoint)Create the initial provider.static WaypointPVBuildergreatCircleBuilder(OneAxisEllipsoid body)Construct a waypoint builder interpolating points using a great-circle.WaypointPVBuilderinvalidAfter()Indicate the resultingPVCoordinatesProvidershould be invalid after the last waypoint.WaypointPVBuilderinvalidBefore()Indicate the resultingPVCoordinatesProvidershould be invalid before the first waypoint.static WaypointPVBuilderloxodromeBuilder(OneAxisEllipsoid body)Construct a waypoint builder interpolating points using a loxodrome (or Rhumbline).
-
-
-
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
-
addWaypoint
public WaypointPVBuilder addWaypoint(GeodeticPoint point, AbsoluteDate date)
Add a waypoint.- Parameters:
point- the waypoint locationdate- the waypoint time- Returns:
- this instance
-
invalidBefore
public WaypointPVBuilder invalidBefore()
Indicate the resultingPVCoordinatesProvidershould be invalid before the first waypoint.- Returns:
- this instance
-
constantBefore
public WaypointPVBuilder constantBefore()
Indicate the resultingPVCoordinatesProviderprovide a constant location of the first waypoint prior to the first time.- Returns:
- this instance
-
invalidAfter
public WaypointPVBuilder invalidAfter()
Indicate the resultingPVCoordinatesProvidershould be invalid after the last waypoint.- Returns:
- this instance
-
constantAfter
public WaypointPVBuilder constantAfter()
Indicate the resultingPVCoordinatesProviderprovide a constant location of the last waypoint after to the last time.- Returns:
- this instance
-
build
public PVCoordinatesProvider build()
Build aPVCoordinatesProviderfrom the waypoints added to this builder.- Returns:
- the coordinates provider instance.
-
createInitial
protected PVCoordinatesProvider createInitial(AbsoluteDate firstDate, GeodeticPoint firstPoint)
Create the initial provider. This method uses the internalvalidBeforeflag 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 calledfirstPoint- the first waypoint- Returns:
- the coordinate provider
-
createFinal
protected PVCoordinatesProvider createFinal(AbsoluteDate lastDate, GeodeticPoint lastPoint)
Create the final provider. This method uses the internalvalidAfterflag 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 calledlastPoint- the last waypoint- Returns:
- the coordinate provider
-
-