Skip to main content

How to Connect Points in Desmos

Draw segments, polygons, and lines through points

By JasonPublished 5 min read

A student climbs an indoor wall, reaching between green holds along a rope line.

To connect points in Desmos, put them in a table, then press and hold the colored circle at the top of the y column and turn on Lines. Desmos joins the points in the order they appear in the table. For a closed shape, type polygon((0,0),(4,0),(4,3)) to draw a triangle.

You can try these examples in our Desmos calculator. Use a table to connect a sequence of points, polygon() for a segment or a filled shape, and regression when you want the full equation of a line.

Connect points with a table

Connect (0,0), (4,0), and (4,3) in that order.

  1. Click the plus button at the top of the expression list and choose Table.
  2. Enter 0 and 0 in the first row, 4 and 0 in the second, and 4 and 3 in the third. Each row is one (x,y) point.
  3. Press and hold the colored circle at the top of the y1 column. Turn on Lines in the style menu.
  4. The graph joins the first point to the second, then the second to the third. To close the triangle with this table, add (0,0) again in the next row.

The button loads the table and its points. Turn on Lines yourself after it opens. The row order matters. Enter corners around the boundary, not across a diagonal. For more table steps, see how to make a table in Desmos.

A segment is not a line

Connecting two points draws the part between them. A line extends in both directions beyond the points. Use the regression method below when the question asks for the equation of the whole line.

Make a segment, triangle, square, or rectangle

Type polygon followed by the points in parentheses. Put each point in its own parentheses and separate the points with commas. Desmos connects the points in order and closes the shape by joining the last point to the first.

Line segment

For a segment from (1,1) to (5,3), type polygon((1,1),(5,3)). With two points there is no interior to fill, and the graph shows the segment between the endpoints.

Triangle

For a triangle with vertices (0,0), (4,0), and (4,3), type polygon((0,0),(4,0),(4,3)). The last side returns to (0,0), and Desmos fills the triangle.

Square

For a square with side length 3, type polygon((0,0),(3,0),(3,3),(0,3)). The four sides have length 3 and meet at right angles.

Rectangle

For a rectangle with width 5 and height 2, type polygon((0,0),(5,0),(5,2),(0,2)). Its opposite sides have equal lengths. Like the triangle and square, the rectangle is closed and filled.

Common mistake

Enter the vertices around the outside of the shape. For example, putting (3,3) immediately after (0,0) in the square draws a diagonal instead of a side. A picture helps catch a typing mistake, but the coordinates determine the answer.

Find the line through two points

A segment stops at its endpoints. To find the equation of the line through (1,3) and (4,9), use a table and a linear regression:

  1. Add a table and enter (1,3) and (4,9) as its two rows.
  2. On a new expression line, type y_1 ~ mx_1 + b. Type the tilde ~ in place of an equals sign.
  3. Read the values: m=2 and b=1. The line is y=2x+1.
  4. Check that Desmos shows R2=1, which means the line passes through both points. Substitute the points into y=2x+1: both 3=2(1)+1 and 9=2(4)+1 hold.

The slope m tells you the change in y for each unit of x; b is the y-intercept. The graphed line extends beyond the two points. This method needs different x-coordinates: two distinct points with the same x-coordinate form a vertical line, whose equation is x= that coordinate and whose slope is undefined. For more on fitting equations, see the Desmos regression guide and how to find slope in Desmos.

Find the length and midpoint of a segment

For endpoints (1,2) and (5,5), first draw the segment with polygon((1,2),(5,5)). Its horizontal change is 5−1=4 and its vertical change is 5−2=3.

  1. For length, type sqrt((5-1)^2+(5-2)^2). Desmos gives 5, using the distance formula d=(x2−x1)2+(y2−y1)2.
  2. For the midpoint, average the x-coordinates and the y-coordinates separately. Type ((1+5)/2,(2+5)/2). Desmos plots (3,3.5).
  3. Check the graph: the midpoint lies halfway along the segment. From (1,2) to (3,3.5) the changes are 2 and 1.5, half the changes along the whole segment.

Use connected points on SAT questions

When a question gives vertices of a triangle or rectangle, draw them with polygon() in boundary order. The picture helps you see which points form a side and which form a diagonal. Then use the coordinates to calculate the length, midpoint, or slope the question asks for. For triangle relationships, see SAT triangles.

To check a right angle, calculate the slopes of the two sides meeting at the vertex. For example, from (0,0) to (2,1) the slope is 1/2; from (0,0) to (−1,2) it is −2. Flip the first fraction and change its sign to get the second slope. Their product is −1, so the sides are perpendicular. If one side is vertical, check whether the other is horizontal instead. See SAT slope for more practice.

Practice with SAT-style questions

Try each question before opening the walkthrough.

Practice question · Lines and Linear Relationships

Show the Detailed Explanation

Use change in y divided by change in x: m=(p+13)−(p−39)8−(−4)=5212=133.

The p terms cancel, so the slope is 133, choice C. You can also pick a value for p, enter the resulting points in a table, and use linear regression to check the slope; use the fraction for the exact answer.

Practice question · Lines and Linear Relationships

Show the Detailed Explanation

For g, use slope −4=40−12k−2. Solving −4(k−2)=28 gives k=−5.

Now the two points on h are (3,−11) and (−5,13). Its slope is 13−(−11)−5−3=24−8=−3, choice C. Enter those two points in a table and use linear regression to check.

Connecting points in Desmos

  1. Put points in a table and turn on Lines to connect consecutive rows.
  2. Use polygon() for a segment or a closed, filled figure; list vertices around the boundary.
  3. Use a table and regression for the equation of the full line through two points.
  4. Calculate distance and midpoint from coordinates, then use the graph to check your setup.

Practice these tools in Desmos Skills training, and see key Desmos features for more calculator methods.

Tutor? Use Resolve Prep with your students