Domain and Range from a Graph Calculator
Build a relation using straight line segments and standalone points. Trace the horizontal and vertical projections, retain exact endpoint inclusion, and check which outputs occur at a chosen x. When two outputs share an input, the worksheet supplies exact coordinates for a failing vertical line.
Find domain and range from an entered graph
Project segments and points onto each axis, then check the vertical-line test.
The entered relation passes the vertical-line test.
Graph and exact projections
At x = -1, the output set is {0}.
Exact domain, range and graph CSV
How to use this calculator
- Enter each segment as x₁, y₁, x₂, y₂, followed by open or closed for each named endpoint.
- Enter a standalone point as x, y, point.
- Follow the domain and range projections and compare their exact interval notation.
- Enter an x value to inspect its output set. When the relation fails the vertical-line test, select the failing-line view.
- Download the graph endpoints, merged intervals and witness coordinates as CSV.
The Formula
The mathematical logic powering this calculation is:
The domain is the set of x coordinates of the graph’s points. The range is the corresponding set of y coordinates. For a nonconstant coordinate along a segment, its projection joins the endpoint coordinates, retaining each endpoint’s inclusion. A constant coordinate projects to one included value because every point in the segment has that coordinate.
Sort projected intervals by their lower boundary. Two overlapping intervals merge. Two intervals that only touch merge when their common boundary is included by at least one of them. An isolated included point can also fill a boundary between open intervals. A gap remains when neither side nor any point contains the boundary.
At a chosen x, ignore segments whose domain excludes x. A nonvertical segment has one interpolated y, with fraction along that segment (x − x₁)/(x₂ − x₁). A vertical segment at the chosen x contributes its complete y interval. Combine the outputs as a set, so coincident graph points appear once.
For the vertical-line test, every nonzero vertical segment provides two different y coordinates at its x. For two nonvertical segments with overlapping positive-width domains, their output difference is affine. If it equals zero at two distinct interior x values, it equals zero throughout the overlap. For one shared included boundary, compare at that exact x. A pair of different outputs supplies a witness. The arithmetic uses exact rational values. SVG positions are drawn to approximate screen coordinates.
Enter one to eight finite straight segments or isolated points, with coordinates from −1,000,000 to 1,000,000 and up to six decimal places. Endpoints at one identical point must both be closed.Worked Example
If you input:
- First segment: (−4, 1) closed to (−1, 3) open
- Second segment: (−1, 0) closed to (2, −2) closed
- Isolated point: (4, 3)
- Inspect x: −1
Result:
Domain is [−4, 2] ∪ {4}. Range is [−2, 0] ∪ [1, 3] because the isolated point includes 3. At x = −1 the only output is 0.
Frequently Asked Questions
How do I read domain and range from a graph?
Project the graph onto the horizontal axis for the domain and the vertical axis for the range. Keep any gaps and track whether each endpoint occurs somewhere on the graph.
Can an open endpoint appear in the projection anyway?
Yes. Another included graph point can have the same x or y coordinate and fill that projected boundary.
Does a vertical segment have a domain?
Yes. It has one x coordinate. It fails the vertical-line test when its points have different y coordinates.
Do overlapping segments always fail the vertical-line test?
Only different y values at a shared x fail the test. Segments that trace the same points contribute one value at each shared x.
What happens at a gap in the domain?
The probe’s output set is empty at an x the graph does not contain.
Similar Calculators
Piecewise Function Graph Calculator
Graph a piecewise function with open and closed endpoints. Evaluate f(x), compare one-sided limits, and identify gaps, jumps and removable discontinuities.
Inverse Function Calculator & Branch Graph
Find inverse rules and exact preimages for quadratic branches and shifted reciprocal functions. See the graphs reflected across y = x.
Slope & Line Equation Calculator
Find slope, intercepts and exact line equations from two points or known coefficients. Graph parallel and perpendicular lines and find the shortest distance from a point.
Inequality Calculator
Solve linear, quadratic and absolute-value inequalities in one real variable. Combine conditions, inspect exact intervals and graph the solution on a number line.
