1.1 Given two points with co-ordinates (r1,y1) and (x2,y2), there is a unique straight line connecting them of the form y = mx + c, where m is the gradient and e is a constant. Write down expressions for the coefficients, m and c, in terms of the co-ordinates of the points. This is lingar internolation
1.1 Given two points with co-ordinates (r1,y1) and (x2,y2), there is a unique straight line connecting them of the form y = mx + c, where m is the gradient and e is a constant. Write down expressions for the coefficients, m and c, in terms of the co-ordinates of the points. This is lingar internolation
Advanced Engineering Mathematics
10th Edition
ISBN:9780470458365
Author:Erwin Kreyszig
Publisher:Erwin Kreyszig
Chapter2: Second-order Linear Odes
Section: Chapter Questions
Problem 1RQ
Related questions
Question
8.1
![Imagine you have a table of data (x;, Y:) but you need to estimate values between those
specific points. The data might be growth rates, chemical reaction rates, profits or even exper-
imental data.
Thus you require an approximate function y(x) at for x values in the range covered by the x;
values provided. We can use an interpolation scheme to estimate values for y for intermediate
values of x that are between values listed in the table.
1.1 Given two points with co-ordinates (x1,y1) and (x2,y2), there is a unique straight line
connecting them of the form y = m + c, where m is the gradient and c is a constant. Write
down expressions for the coefficients, m and c, in terms of the co-ordinates of the points. This
is linear interpolation.
1.2 Write a float function called interpolate that takes two pairs of float coordinates and
an intermediate x value (a total of 5 float arguments: x1, yl, x2, y2 and x). The function
should return a y value based on the straight line fit of the points. Incorporate your function
into a file interp.cpp.
Consider if your function needs to check the input values in any way and add any checking
you consider necessary.
1.3 Testing: Write a short main function in a file called testinterp.cpp to test your
function. Note that you will need a Makefile that is able to combine the two files interp.cpp
and testinterp.cpp to generate the test program: testinterp.
Have your program print out (using cout) what your interpolate function returns. Run
your program for the following point and report the values:
(x1,y1)=(1, 8.57), (x2,y2)=(2, 10.28) and an r value of 1.25.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fed4162e7-c43a-41f9-89d0-c16de8b74d1d%2F993a0995-1c40-4e9a-b913-a6d9a9df0c7d%2Ffnt8zyp_processed.png&w=3840&q=75)
Transcribed Image Text:Imagine you have a table of data (x;, Y:) but you need to estimate values between those
specific points. The data might be growth rates, chemical reaction rates, profits or even exper-
imental data.
Thus you require an approximate function y(x) at for x values in the range covered by the x;
values provided. We can use an interpolation scheme to estimate values for y for intermediate
values of x that are between values listed in the table.
1.1 Given two points with co-ordinates (x1,y1) and (x2,y2), there is a unique straight line
connecting them of the form y = m + c, where m is the gradient and c is a constant. Write
down expressions for the coefficients, m and c, in terms of the co-ordinates of the points. This
is linear interpolation.
1.2 Write a float function called interpolate that takes two pairs of float coordinates and
an intermediate x value (a total of 5 float arguments: x1, yl, x2, y2 and x). The function
should return a y value based on the straight line fit of the points. Incorporate your function
into a file interp.cpp.
Consider if your function needs to check the input values in any way and add any checking
you consider necessary.
1.3 Testing: Write a short main function in a file called testinterp.cpp to test your
function. Note that you will need a Makefile that is able to combine the two files interp.cpp
and testinterp.cpp to generate the test program: testinterp.
Have your program print out (using cout) what your interpolate function returns. Run
your program for the following point and report the values:
(x1,y1)=(1, 8.57), (x2,y2)=(2, 10.28) and an r value of 1.25.
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 4 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Recommended textbooks for you
![Advanced Engineering Mathematics](https://www.bartleby.com/isbn_cover_images/9780470458365/9780470458365_smallCoverImage.gif)
Advanced Engineering Mathematics
Advanced Math
ISBN:
9780470458365
Author:
Erwin Kreyszig
Publisher:
Wiley, John & Sons, Incorporated
![Numerical Methods for Engineers](https://www.bartleby.com/isbn_cover_images/9780073397924/9780073397924_smallCoverImage.gif)
Numerical Methods for Engineers
Advanced Math
ISBN:
9780073397924
Author:
Steven C. Chapra Dr., Raymond P. Canale
Publisher:
McGraw-Hill Education
![Introductory Mathematics for Engineering Applicat…](https://www.bartleby.com/isbn_cover_images/9781118141809/9781118141809_smallCoverImage.gif)
Introductory Mathematics for Engineering Applicat…
Advanced Math
ISBN:
9781118141809
Author:
Nathan Klingbeil
Publisher:
WILEY
![Advanced Engineering Mathematics](https://www.bartleby.com/isbn_cover_images/9780470458365/9780470458365_smallCoverImage.gif)
Advanced Engineering Mathematics
Advanced Math
ISBN:
9780470458365
Author:
Erwin Kreyszig
Publisher:
Wiley, John & Sons, Incorporated
![Numerical Methods for Engineers](https://www.bartleby.com/isbn_cover_images/9780073397924/9780073397924_smallCoverImage.gif)
Numerical Methods for Engineers
Advanced Math
ISBN:
9780073397924
Author:
Steven C. Chapra Dr., Raymond P. Canale
Publisher:
McGraw-Hill Education
![Introductory Mathematics for Engineering Applicat…](https://www.bartleby.com/isbn_cover_images/9781118141809/9781118141809_smallCoverImage.gif)
Introductory Mathematics for Engineering Applicat…
Advanced Math
ISBN:
9781118141809
Author:
Nathan Klingbeil
Publisher:
WILEY
![Mathematics For Machine Technology](https://www.bartleby.com/isbn_cover_images/9781337798310/9781337798310_smallCoverImage.jpg)
Mathematics For Machine Technology
Advanced Math
ISBN:
9781337798310
Author:
Peterson, John.
Publisher:
Cengage Learning,
![Basic Technical Mathematics](https://www.bartleby.com/isbn_cover_images/9780134437705/9780134437705_smallCoverImage.gif)
![Topology](https://www.bartleby.com/isbn_cover_images/9780134689517/9780134689517_smallCoverImage.gif)