Package org.orekit.utils
Class WaypointPVBuilder
- java.lang.Object
-
- org.orekit.utils.WaypointPVBuilder
-
public class WaypointPVBuilder extends Object
Builder class, enabling incremental building of anPVCoordinatesProvider
instance using waypoints defined on an ellipsoid. Given a series of waypoints ((date, point)
tuples), build aPVCoordinatesProvider
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 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 thePVCoordinatesProvider
will be used in the particular application.- Since:
- 11.3
- Author:
- Joe Reed
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
WaypointPVBuilder.InterpolationFactory
Factory interface, creating thePVCoordinatesProvider
instances 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 WaypointPVBuilder
addWaypoint(GeodeticPoint point, AbsoluteDate date)
Add a waypoint.PVCoordinatesProvider
build()
Build aPVCoordinatesProvider
from the waypoints added to this builder.static WaypointPVBuilder
cartesianBuilder(OneAxisEllipsoid body)
Construct a waypoint builder interpolating points using a linear cartesian interpolation.WaypointPVBuilder
constantAfter()
Indicate the resultingPVCoordinatesProvider
provide a constant location of the last waypoint after to the last time.WaypointPVBuilder
constantBefore()
Indicate the resultingPVCoordinatesProvider
provide a constant location of the first waypoint prior to the first time.protected PVCoordinatesProvider
createFinal(AbsoluteDate lastDate, GeodeticPoint lastPoint)
Create the final provider.protected PVCoordinatesProvider
createInitial(AbsoluteDate firstDate, GeodeticPoint firstPoint)
Create the initial provider.static WaypointPVBuilder
greatCircleBuilder(OneAxisEllipsoid body)
Construct a waypoint builder interpolating points using a great-circle.WaypointPVBuilder
invalidAfter()
Indicate the resultingPVCoordinatesProvider
should be invalid after the last waypoint.WaypointPVBuilder
invalidBefore()
Indicate the resultingPVCoordinatesProvider
should be invalid before the first waypoint.static WaypointPVBuilder
loxodromeBuilder(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 resultingPVCoordinatesProvider
should be invalid before the first waypoint.- Returns:
- this instance
-
constantBefore
public WaypointPVBuilder constantBefore()
Indicate the resultingPVCoordinatesProvider
provide a constant location of the first waypoint prior to the first time.- Returns:
- this instance
-
invalidAfter
public WaypointPVBuilder invalidAfter()
Indicate the resultingPVCoordinatesProvider
should be invalid after the last waypoint.- Returns:
- this instance
-
constantAfter
public WaypointPVBuilder constantAfter()
Indicate the resultingPVCoordinatesProvider
provide a constant location of the last waypoint after to the last time.- Returns:
- this instance
-
build
public PVCoordinatesProvider build()
Build aPVCoordinatesProvider
from 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 internalvalidBefore
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 calledfirstPoint
- the first waypoint- Returns:
- the coordinate provider
-
createFinal
protected PVCoordinatesProvider createFinal(AbsoluteDate lastDate, GeodeticPoint lastPoint)
Create the final provider. This method uses the internalvalidAfter
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 calledlastPoint
- the last waypoint- Returns:
- the coordinate provider
-
-