File:Quadratic interpolation.svg

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Original file(SVG file, nominally 752 × 564 pixels, file size: 105 KB)

Captions

Captions

Add a one-line explanation of what this file represents

Summary[edit]

Description
English: example of quadratic interpolation
Date
Source Own work
Author User:DaBler

Licensing[edit]

Public domain I, the copyright holder of this work, release this work into the public domain. This applies worldwide.
In some countries this may not be legally possible; if so:
I grant anyone the right to use this work for any purpose, without any conditions, unless such conditions are required by law.

Source code[edit]

Plotted in GNU Octave:

clear;

figure(1);
subplot(211);
hold off;

x = [-1 0 1];
y = [-1 3 2];

stem( x, y );
hold on;

a = (y(1)-2*y(2)+y(3))/2;
b = (y(3)-y(1))/2;
c = y(2);

t = [-2000:+2000]./1000;

p = a*t.*t+b*t+c;

plot( t, p );

t_max = -b/2/a;
p_max = a*t_max.*t_max+b*t_max+c;

h=stem( t_max, p_max, "r" );

ylim([-2 5]);
xlim([-2 2])

legend("f[x]", "f(x)", "f(x) = max")
xlabel("x");
ylabel("y","Rotation",0);

subplot(212);
hold off;
plot( t(1:end-1), diff(p,1) );
hold on;
h=stem(t_max, 0, "r");

xlim([-2 2])
legend("f'(x)", "f'(x) = 0")
xlabel("x");
ylabel("y","Rotation",0);

print("quadratic_interpolation.svg");

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current16:17, 7 March 2010Thumbnail for version as of 16:17, 7 March 2010752 × 564 (105 KB)DaBler (talk | contribs)same x-ranges
15:21, 7 March 2010Thumbnail for version as of 15:21, 7 March 2010752 × 564 (104 KB)DaBler (talk | contribs){{Information | Description = {{en|example of quadratic interpolation}} | Source = {{own}} | Date = 2010-03-07 | Author = User:DaBler | Permission = | other_versions = }} Category:Interpolation

There are no pages that use this file.

Metadata