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.
Try your own numbers
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
- The arithmetic of the published formula for the values you entered, in the units shown.
What remains unverified
- That the inputs suit your application. Take ratings, resistances and constants from the manufacturer data sheet or project specification.
Verification register entry
| Calculation author | Rahul Sharma (author) |
|---|---|
| Technical review | No independent technical review has been carried out |
| Individual professional approval | Not recorded |
| Formula reference | not recorded |
| Standard and edition | Not applicable: Pure mathematics or statistics; no electrical standard governs the method |
| Standard review state | Not applicable |
| Scope-screening note | not recorded |
| Cross-check test cases | 29 reference vectors (tests/reference_vectors.json) |
| Review date | not recorded |
| Next review date | not recorded |
| Status | Engineering 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
Worked example
| Input | Value |
|---|---|
| First point, x₁ | 0 |
| First point, y₁ | 4 |
| Second point, x₂ | 100 |
| Second point, y₂ | 20 |
| x to look up | 25 |
- Slope m = (y₂ − y₁) / (x₂ − x₁) = (20 − 4) / (100 − 0) = 0.16
- y = y₁ + (x − x₁) × m = 4 + (25 − 0) × 0.16 = 8
- Fraction of the way from x₁ to x₂ = (x − x₁) / (x₂ − x₁) = 0.25
- To find an x from a y, enter the y to look up
Assumptions
- 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
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
| Input | Unit | Allowed or shown | Note |
|---|---|---|---|
| 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,000 | Must 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,000 | The 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 blank | Enter a y to find the x that gives it. Leave blank to skip. y₁ and y₂ must differ. |
| Result | Unit | Allowed or shown | Note |
|---|---|---|---|
| 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 x | Slope m = | Fraction of the way from x₁ to x₂ |
|---|---|---|---|
| 0.4 | 5.3 | 0.196 | 0.25 |
| 1 | 5.75 | 0.19 | 0.25 |
| 2 | 6.5 | 0.18 | 0.25 |
| 4 | 8 | 0.16 | 0.25 |
| 8 | 11 | 0.12 | 0.25 |
| 16 | 17 | 0.04 | 0.25 |
| 40 | 35 | -0.2 | 0.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.
- 4-20 mA Loop Formulas: Scaling and Resistor: 4-20 mA current loop formulas: current from process value, process value from current
- Measurement Uncertainty Formulas: Measurement uncertainty formulas: the standard uncertainty of a rectangular limit
- Pt100 RTD Formulas: Resistance and Temperature: Pt100 RTD formulas: resistance from temperature (Callendar-Van Dusen), temperature from resistance
More Engineering Mathematics calculatorsAll engineering calculatorsLinear Interpolation Calculator in Elecmetric