Why this answer
Move proportionally between the endpoints
Find how far x sits between x₁ and x₂, then apply that same fraction to the change from y₁ to y₂.
Why the same fraction: the piece of the line from (x₁, y₁) to your point and the whole segment to (x₂, y₂) form two right triangles with the same slant, so one is a scaled copy of the other. Every side scales by the same factor, so the fraction across equals the fraction up. Outside x₁…x₂ the fraction goes below 0 or above 1: that's extrapolation, and it only holds if the straight-line trend really continues.
y = 10 + (5 − 0) / (10 − 0) × (30 − 10)