|
FERS 1.0.0
The Flexible Extensible Radar Simulator
|
Utility functions for path interpolation and exception handling. More...
#include <algorithm>
Include dependency graph for path_utils.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Classes | |
| class | math::PathException |
| Exception class for handling path-related errors. More... | |
Namespaces | |
| namespace | math |
Concepts | |
| concept | Interpolatable |
| Concept for types that can be interpolated. | |
Functions | |
| template<Interpolatable T> | |
| void | getPositionStatic (T &coord, const std::vector< T > &coords) |
| Interpolates a static position from a list of coordinates. | |
| template<Interpolatable T> | |
| void | getPositionLinear (RealType t, T &coord, const std::vector< T > &coords) |
| Performs linear interpolation between coordinate points. | |
| template<Interpolatable T> | |
| void | getPositionCubic (RealType t, T &coord, const std::vector< T > &coords, const std::vector< T > &dd) |
| Performs cubic spline interpolation between coordinate points. | |
| template<Interpolatable T> | |
| void | finalizeCubic (const std::vector< T > &coords, std::vector< T > &dd) |
| Finalizes cubic spline interpolation by calculating second derivatives. | |
Utility functions for path interpolation and exception handling.
The cubic interpolation functions are based on methods described in "Numerical Recipes in C, Second Edition" by Press et al., but the code here is distinct from the original.
Definition in file path_utils.h.
| void finalizeCubic | ( | const std::vector< T > & | coords, |
| std::vector< T > & | dd | ||
| ) |
Finalizes cubic spline interpolation by calculating second derivatives.
| T | The type of the coordinate, which must satisfy the Interpolatable concept. |
| coords | A vector of coordinates for which second derivatives will be calculated. |
| dd | The output vector that will store the calculated second derivatives. |
| PathException | if there are fewer than two points for interpolation. |
Definition at line 173 of file path_utils.h.
Referenced by math::RotationPath::finalize().
Here is the caller graph for this function:| void getPositionCubic | ( | RealType | t, |
| T & | coord, | ||
| const std::vector< T > & | coords, | ||
| const std::vector< T > & | dd | ||
| ) |
Performs cubic spline interpolation between coordinate points.
The method used for calculating the spline is from "Numerical Recipes in C."
| T | The type of the coordinate, which must satisfy the Interpolatable concept. |
| t | The interpolation factor (usually time) to determine the position. |
| coord | The output coordinate that will be interpolated. |
| coords | A vector of coordinates to interpolate between. |
| dd | A vector of second derivatives used in the cubic interpolation. |
| PathException | if the list of coordinates is empty. |
Definition at line 128 of file path_utils.h.
Referenced by math::Path::getPosition(), and math::RotationPath::getPosition().
Here is the caller graph for this function:| void getPositionLinear | ( | RealType | t, |
| T & | coord, | ||
| const std::vector< T > & | coords | ||
| ) |
Performs linear interpolation between coordinate points.
| T | The type of the coordinate, which must satisfy the Interpolatable concept. |
| t | The interpolation factor (usually time) to determine the position. |
| coord | The output coordinate that will be interpolated. |
| coords | A vector of coordinates to interpolate between. |
| PathException | if the list of coordinates is empty. |
Definition at line 85 of file path_utils.h.
Referenced by math::Path::getPosition(), and math::RotationPath::getPosition().
Here is the caller graph for this function:| void getPositionStatic | ( | T & | coord, |
| const std::vector< T > & | coords | ||
| ) |
Interpolates a static position from a list of coordinates.
| T | The type of the coordinate, which must satisfy the Interpolatable concept. |
| coord | The output coordinate to be set. |
| coords | A vector of coordinates from which the first will be selected. |
| PathException | if the list of coordinates is empty. |
Definition at line 66 of file path_utils.h.
Referenced by math::Path::getPosition(), and math::RotationPath::getPosition().
Here is the caller graph for this function: