I'm working on a function that asks the user for how many roots they have, that then sets the size an array for them to be stored in. From there I need to plug those roots in (up to x^4) and graph the polynomial. I already have a similiar on that sets up by coefficients.... I guess I'm just lost on how to code the formula for the roots.
Let's say the user enters in -1 2 -3 4... Would my best bet be to alter them by multiplying by -1 right then and there... say maybe
for (root_count=0; root_count<array_size; root_count++)
printf("Enter a root:");
Can Something like be done or would I have to set up another loop to pull them back out and alter them?
If that does work, from there I need some serious help with the loop to output what is to be graphed. I think what I would want to do is ask the user for the range and set up a while loop saying while in set range, x=range, and plug in x values from start to end in whatever the formula is...
Am I on the right track? And if someone has a formula already written out for getting ax^4+bx^3+cx^2+dx+constant from the roots that would be cool if you shared it.