#include <stdio.h>
#define LEN 4
int main()
{
int i;
printf("\nRandom polynomials of orders 0-9\n");
for(i=1;i<=10;i++){
}
printf("\npolynomial of ones a:\n");
printf("polynomial of ones b:\n");
printf("Polynomial convolution a*b:\n");
printf("\na to the power of 0-5:\n");
for(i=0;i<=5;i++){
}
printf("\nrc_poly_subtract c=b-a\n");
printf("\nrc_poly_subtract_inplace c=c-a\n");
printf("\nrc_poly_add a+b=c\n");
printf("\nrc_poly_add_inplace c=c+a\n");
printf("0st-3rd derivative of b\n");
for(i=0;i<=3;i++){
}
printf("\nNew polynomial a:\n");
printf("\nNew polynomial b:\n");
printf("\ndivide a into b\n");
printf("remainder:\n");
printf("\nConfirm by multiplying the result and adding remainder\n");
printf("\nfirst 4 butterworth polynomials\n");
for(i=1;i<=4;i++){
}
printf("\nDONE\n");
return 0;
}
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.
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.
int rc_poly_subtract_inplace(rc_vector_t *a, rc_vector_t b)
Subtracts b from a with right justification.
int rc_poly_add_inplace(rc_vector_t *a, rc_vector_t b)
Adds polynomials a&b with right justification.
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...
int rc_poly_print(rc_vector_t v)
Prints a polynomial in human-readable format in one line.
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...
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.
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.
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.
int rc_vector_random(rc_vector_t *v, int length)
Resizes vector v and fills with random numbers between -1.0 and 1.0.
int rc_vector_free(rc_vector_t *v)
Frees the memory allocated for vector v.
int rc_vector_ones(rc_vector_t *v, int length)
Resizes vector v and fills with ones.
int rc_vector_fibonnaci(rc_vector_t *v, int length)
Resizes vector v and fills with Fibonnaci sequence.
#define RC_VECTOR_INITIALIZER
Definition: vector.h:48
Struct containing the state of a vector and a pointer to dynamically allocated memory to hold its con...
Definition: vector.h:41