|
int | factorial (int n) |
|
int | mbs_polynomial_check (MbsPolynomial *poly) |
| Check the validity of the provided polynomial. More...
|
|
MbsPolynomial * | mbs_polynomial_new (int order) |
| Allocate a polynomial. More...
|
|
void * | mbs_polynomial_delete (MbsPolynomial *poly) |
| Free a polynomial and return NULL. More...
|
|
MbsPolynomial * | mbs_polynomial_constrained (int nb_pos, double **pos_xy, int nb_deriv, double **deriv_xyp) |
| Create a polynomial fulfilling the position and first derivative. More...
|
|
double | mbs_polynomial_get_value (MbsPolynomial *poly, double x, int deriv) |
| Evaluate the polynomial without any checks. More...
|
|
int | mbs_polynomial_eval (MbsPolynomial *poly, double x, double *y, int deriv) |
| Evaluate the polynomial (or its nth derivative) at the provided coordinate. More...
|
|
int | mbs_polynomial_print (MbsPolynomial *poly) |
| Print information about the polynomial. More...
|
|
int | mbs_polynomial_eval_vec (MbsPolynomial *poly, int nx, double *vx, double **p_vy, int deriv) |
| Evaluate the polynomial (or its nth derivative) at the provided coordinates vector. More...
|
|
Implement polynomial-related function for MBsysC.
Creation date: 21-06-2023
- Author
- Robotran team
(c) Universite catholique de Louvain
MbsPolynomial* mbs_polynomial_constrained |
( |
int |
nb_pos, |
|
|
double ** |
pos_xy, |
|
|
int |
nb_deriv, |
|
|
double ** |
deriv_xyp |
|
) |
| |
Create a polynomial fulfilling the position and first derivative.
The function is not optimized and may use a big amount of memory for heavily constrained polynomial. It uses a LU decomposition to solve the system.
Polynomial interpolation is not adapted when order is high due to the Runge's phenomenon.
The order of the polynomial is computed from the number of condition set.
- Parameters
-
[in] | nb_pos | The number of position that the polynomial must pass by. Must be strictly positive. |
[in] | pos_xy | The array containing the x and y coordinates of the function. The size is [nb_pos; 2]. Duplicated x-coordinates are forbidden. |
[in] | nb_deriv | The number of specified polynomial derivative. Must be positive or null. |
[in] | deriv_xyp | The array containing the x coordinates and the yp derivative of the function. The size is [nb_pos; 2]. Duplicated x-coordinates are forbidden. NULL can be provided if nb_deriv is null. |
- Returns
- A polynomial that fulfills the position and derivative. NULL if no such polynomial exists.