The quickest way to connect two points

To connect two points in Desmos, you type a line equation directly into the calculator. The simplest method is to enter the equation in slope-intercept form — y = mx + b — where m is the slope and b is the y-intercept. If you know your two points, you can calculate the slope yourself, or you can let Desmos do the work by entering a point-slope equation instead.

Desmos will draw the line across the entire graph by default. If you want the line to stop at your two points instead of extending infinitely, you can restrict it using a domain — a mathematical way of saying "only draw this between x = 1 and x = 5" or whatever your endpoints are.

Key Takeaways

  • The slope-intercept form y = mx + b works if you calculate the slope from your two points first, or use point-slope form y - y₁ = m(x - x₁) to let Desmos handle the math.
  • You can restrict a line to only the segment between your two points by adding a domain condition like {a ≤ x ≤ b} after your equation.
  • Plotting the points themselves as ordered pairs (like (2, 3) and (5, 7)) shows them as dots on the graph before you draw the line.
  • If you want to see the exact slope and equation, you can use Desmos's table feature to enter your points and let it calculate the line of best fit.

Using slope-intercept form when you know the slope

If you have already calculated the slope from your two points, enter the equation y = mx + b into Desmos. Replace m with your slope and b with your y-intercept. For example, if your slope is 2 and your y-intercept is 3, type y = 2x + 3. Desmos draws the line when ready.

To find the y-intercept from two points, substitute one of your points into the equation and solve for b. If your points are (1, 5) and (3, 9), the slope is (9 − 5) ÷ (3 − 1) = 2. Plugging in the first point: 5 = 2(1) + b, so b = 3. Your equation is y = 2x + 3.

Using point-slope form to skip the calculation

Point-slope form is y − y₁ = m(x − x₁), where (x₁, y₁) is one of your points and m is the slope. This form works in Desmos without converting to slope-intercept first. If your points are (2, 4) and (6, 12), the slope is (12 − 4) ÷ (6 − 2) = 2. Type y − 4 = 2(x − 2) into Desmos and it draws the line.

The advantage of point-slope form is that you do not have to find the y-intercept — you just plug in a point and the slope, and Desmos handles the rest. This is faster when you are working with points that are not near the y-axis.

Restricting the line to only the segment between your points

By default, Desmos extends your line infinitely in both directions. To draw only the segment connecting your two points, add a domain restriction using curly braces. The syntax is {a ≤ x ≤ b} at the end of your equation, where a and b are the x-coordinates of your two points.

If your points are (1, 3) and (5, 11), type y = 2x + 1 {1 ≤ x ≤ 5}. Desmos now draws only the line segment between x = 1 and x = 5. The curly braces tell Desmos to restrict the domain — the set of x-values where the equation is active.

Make sure your two x-coordinates are in order from smallest to largest. If one point has x = 5 and the other has x = 2, use {2 ≤ x ≤ 5}, not the other way around.

Plotting the points themselves so you can see them

Desmos does not automatically mark your two points on the graph — it only draws the line. To see the points as dots, enter them as ordered pairs on separate lines. Type (1, 3) on one line and (5, 11) on another. Desmos marks both as points.

This is useful for checking your work. If the line passes through both points, your equation is correct. If it misses one or both, recalculate your slope or check your arithmetic.

Using Desmos's table feature to find the line automatically

If you want Desmos to calculate the line for you, enter your points into a table. Click the plus sign in the top left, select "Table", and enter your x and y values. Desmos shows you the points and can fit a line through them.

This method is slower than typing an equation directly, but it is useful if you have many points or want to see the regression equation — the line that best fits all your data. For just two points, typing the equation is faster.

Frequently Asked Questions

What if my two points have the same x-coordinate?

You have a vertical line, and slope-intercept form does not work. Instead, type x = a, where a is the shared x-coordinate. If both points are at x = 3, type x = 3. To restrict it to only the segment, use x = 3 {b ≤ y ≤ c}, where b and c are your y-coordinates.

How do I know if I calculated the slope correctly?

Use the formula (y₂ − y₁) ÷ (x₂ − x₁). Subtract the y-values, subtract the x-values in the same order, then divide. If you get a negative number, that is correct — it means the line slopes downward. Plug your slope and one point into y − y₁ = m(x − x₁) and check that the other point satisfies the equation.

Can I draw a line segment without typing an equation?

Not directly in Desmos. You must enter either an equation or the two points. The equation method is faster for a single segment. If you want to draw freehand, Desmos is not the right tool — use a graphing or drawing app instead.

What does the curly brace syntax do exactly?

Curly braces in Desmos restrict where an equation is active. {1 ≤ x ≤ 5} means "only draw this equation when x is between 1 and 5". You can also use {x > 3} for "only when x is greater than 3" or {y ≠ 0} for "everywhere except y = 0". This works with any equation, not just lines.