Jul8-11, 10:55 AM
Hello, i have done the following code in c++ which gives me a result but :
1) I compute the product "prod*=(y-x[i])/(x[k]-x[i])" which has variable "y" inside ,but the result i take is just a number.(i want the result to be for example in this form "p(x)=1.02*x^3+2*x^2..."
I can't understand how the program manipulates the variable y which does hasn't a value!
2) I don't know if i have it right..
The exercise is :
Find Lagrange's polynomial approximation for y(x)=cos(π x), x ∈−1,1 using 5 points
(x = -1, -0.5, 0, 0.5, and 1).
My code :
|Register to reply|
|Approximation||Calculus & Beyond Homework||4|
|Log Approximation||Calculus & Beyond Homework||7|
|What is BCS approximation?||Quantum Physics||10|
|second approximation||General Math||1|
|Approximation math problem||General Math||1|