Linear Diophantine Equations — Stepping Along the Solution Line

a·x + b·y = c is solvable iff gcd(a,b) | c. Watch the integer solutions march along the line by the step vector (b/g, −a/g). Green = non-negative (constrained) solutions.

step 0

Integer lattice & the line a·x + b·y = c

lattice point solution non-negative solution current

Solver state

Solutions (t near 0):
Press Step to begin. We compute g = gcd(a,b), check g | c, find one solution by scaling Bezout coefficients, then walk the family by (b/g, −a/g).
Self-contained visualization. Solvability: a solution exists iff gcd(a,b) divides c. General solution: x = x0 + (b/g)t, y = y0 − (a/g)t. Non-negative solutions (green) are the ones with x ≥ 0 and y ≥ 0. See junior.md and professional.md for the proofs.