Elecmetric

Linear Interpolation Calculator

Find y at a chosen x on the straight line through two known points (x₁, y₁) and (x₂, y₂), or find the x that gives a chosen y.

First point, x₁ 0, first point, y₁ 4, second point, x₂ 100, second point, y₂ 20 gives
y at the chosen x: 8 · Slope m =: 0.16 · Fraction of the way from x₁ to x₂: 0.25

Estimate only. Not engineering or safety advice. Check the result against the applicable standard and the equipment data, and have a competent engineer review it before it is relied on. Terms of use.

Open in the calculator with these values

About this calculator

This page calculates y at the chosen x, slope m = /, fraction of the way from x₁ to x₂ and 2 more results from first point, x₁, first point, y₁, second point, x₂, second point, y₂ and 2 more inputs. Change any value or its unit and the result updates. The steps below show the working for the default values, so you can check each line against your own method.

Limits of this calculator

Use this to read a value between two rows of a table, to scale a transducer, such as 4 to 20 mA to 0 to 100 °C, or to estimate a cable or transformer rating between two published sizes. For a curved relation use a point close to each side of the value you want, or the published formula. Check an extrapolated value against the maker's data.

Cross-check: 29 reference cases, calculated from textbook formulas coded separately from the engine by the same author, agree with this calculator. This is not an independent review.

Verification status: Engineering reference

Engineering reference. Formula and method documented and tested against separately coded reference calculations. Not yet Verified: the evidence listed on this page is still needed.

What this calculator checks

What remains unverified

Verification register entry

Calculation authorRahul Sharma (author)
Technical reviewNo independent technical review has been carried out
Individual professional approvalNot recorded
Formula referencenot recorded
Standard and editionNot applicable: Pure mathematics or statistics; no electrical standard governs the method
Standard review stateNot applicable
Scope-screening notenot recorded
Cross-check test cases29 reference vectors (tests/reference_vectors.json)
Review datenot recorded
Next review datenot recorded
StatusEngineering reference

Needed before this calculator can be marked Verified: reviewer name, qualification and review date; exact formula reference; formula source (textbook or standard); next review date.

Formula

y = y₁ + (x − x₁) × (y₂ − y₁) / (x₂ − x₁) x = x₁ + (y − y₁) × (x₂ − x₁) / (y₂ − y₁) slope m = (y₂ − y₁) / (x₂ − x₁) fraction t = (x − x₁) / (x₂ − x₁)

Worked example

InputValue
First point, x₁0
First point, y₁4
Second point, x₂100
Second point, y₂20
x to look up25
  1. Slope m = (y₂ − y₁) / (x₂ − x₁) = (20 − 4) / (100 − 0) = 0.16
  2. y = y₁ + (x − x₁) × m = 4 + (25 − 0) × 0.16 = 8
  3. Fraction of the way from x₁ to x₂ = (x − x₁) / (x₂ − x₁) = 0.25
  4. To find an x from a y, enter the y to look up

Assumptions

Use this to read a value between two rows of a table, to scale a transducer, such as 4 to 20 mA to 0 to 100 °C, or to estimate a cable or transformer rating between two published sizes. For a curved relation use a point close to each side of the value you want, or the published formula. Check an extrapolated value against the maker's data.

Inputs and results

InputUnitAllowed or shownNote
First point, x₁(number)-1,000,000,000,000 or more, up to 1,000,000,000,000
First point, y₁(number)-1,000,000,000,000 or more, up to 1,000,000,000,000
Second point, x₂(number)-1,000,000,000,000 or more, up to 1,000,000,000,000Must differ from x₁.
Second point, y₂(number)-1,000,000,000,000 or more, up to 1,000,000,000,000
x to look up(number)-1,000,000,000,000 or more, up to 1,000,000,000,000The x at which you want y.
y to look up (optional)(number)-1,000,000,000,000 or more, up to 1,000,000,000,000; may be left blankEnter a y to find the x that gives it. Leave blank to skip. y₁ and y₂ must differ.
ResultUnitAllowed or shownNote
y at the chosen x(number)Shown to 10 decimal places
Slope m = (y₂ − y₁) / (x₂ − x₁)(number)Shown to 10 decimal places
Fraction of the way from x₁ to x₂(number)Shown to 10 decimal places
Value of y at x = 0(number)Shown to 10 decimal places
x at the chosen y(number)Shown to 10 decimal places

How it is calculated

Each input is converted to the base unit of its quantity, the formula above is applied in the order shown in the worked example, and each result is shown in the unit you choose. Results are held at full precision and rounded only for display, except where a step selects a standard size, as the worked example shows. A value outside its allowed range is refused with a message instead of giving a result.

How the result changes with first point, y₁

First point, y₁y at the chosen xSlope m =Fraction of the way from x₁ to x₂
0.45.30.1960.25
15.750.190.25
26.50.180.25
480.160.25
8110.120.25
16170.040.25
4035-0.20.25

Other inputs are the same as in the worked example above.

Standards and further reading

Complex numbers, rectangular and polar form and angle conversion are standard mathematics, not the subject of a standard. Standards apply when the result feeds an electrical design, and they set the method there.

Frequently asked questions

What do I need to enter?

Enter first point, x₁, first point, y₁, second point, x₂, second point, y₂, x to look up and y to look up (optional). Change the unit of a value with its selector and the result stays the same.

What does this calculator assume?

Between the two points the quantity is assumed to change in a straight line, which is only an approximation for a curve such as a thermistor or a lamp characteristic; use points close together for a curve. x₂ must differ from x₁, and y₂ must differ from y₁ to find an x from a y. A chosen x or y outside the two points is extrapolation, and is less reliable: the line is assumed to continue. The fraction is 0 at the first point and 1 at the second; below 0 or above 1 means the value is outside the points. The points can be in any order and the line can slope up or down.

Which calculators should I use next?

Common next steps are Simultaneous Equations Solver, 4-20 mA Signal Scaling, Percentage Calculator and Rounding and Significant Figures. The related links at the bottom of this page open them.

How accurate are the results?

Every figure comes from the same tested engine as the Elecmetric calculators and is meant for estimating. 29 reference cases, calculated from textbook formulas coded separately from the engine by the same author, agree with this calculator. This is not an independent review. Check design values against the standard and the equipment data you work to.

Formula guides and reference

Longer explanations with worked examples and tables, written for the same topic.

More Engineering Mathematics calculatorsAll engineering calculatorsLinear Interpolation Calculator in Elecmetric

Tell us how to improve this page

This opens your email app. Nothing is sent until you press send.