MBot Software Library  v1.0
An API documentation to mbot_firmware repository
polynomial.h
1 
20 #ifndef RC_POLYNOMIAL_H
21 #define RC_POLYNOMIAL_H
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 #include <rc/math/vector.h>
28 
42 
57 
71 int rc_poly_power(rc_vector_t a, int n, rc_vector_t* b);
72 
86 
99 
114 
126 
138 
151 
162 int rc_poly_butter(int N, double wc, rc_vector_t* b);
163 
164 
165 
166 #ifdef __cplusplus
167 }
168 #endif
169 
170 #endif // RC_POLYNOMIAL_H
171 
int rc_poly_subtract(rc_vector_t a, rc_vector_t b, rc_vector_t *c)
Subtracts two polynomials a-b with right justification and places the result in c.
Definition: polynomial.c:160
int rc_poly_conv(rc_vector_t a, rc_vector_t b, rc_vector_t *c)
Convolutes the polynomials a&b and places the result in vector c.
Definition: polynomial.c:48
int rc_poly_subtract_inplace(rc_vector_t *a, rc_vector_t b)
Subtracts b from a with right justification.
Definition: polynomial.c:188
int rc_poly_add_inplace(rc_vector_t *a, rc_vector_t b)
Adds polynomials a&b with right justification.
Definition: polynomial.c:142
int rc_poly_butter(int N, double wc, rc_vector_t *b)
Calculates coefficients for continuous-time Butterworth polynomial of order N and cutoff wc (rad/s) a...
Definition: polynomial.c:298
int rc_poly_print(rc_vector_t v)
Prints a polynomial in human-readable format in one line.
Definition: polynomial.c:23
int rc_poly_divide(rc_vector_t n, rc_vector_t d, rc_vector_t *div, rc_vector_t *rem)
Divides denominator d into numerator n. The remainder is placed into vector rem and the divisor is pl...
Definition: polynomial.c:251
int rc_poly_differentiate(rc_vector_t a, int d, rc_vector_t *b)
Calculates the dth derivative of the polynomial a and places the result in vector b.
Definition: polynomial.c:206
int rc_poly_add(rc_vector_t a, rc_vector_t b, rc_vector_t *c)
Add two polynomials a&b with right justification and place the result in c.
Definition: polynomial.c:114
int rc_poly_power(rc_vector_t a, int n, rc_vector_t *b)
Raises a polynomial a to itself n times where n is greater than or equal to 0.
Definition: polynomial.c:69
Struct containing the state of a vector and a pointer to dynamically allocated memory to hold its con...
Definition: vector.h:41