Coordinate Geometry Calculator for Points, Lines, Triangles and Polygons

Nine tools in one. Find distance, midpoint, slope and the line through two points. Build parallel and perpendicular lines, find where lines meet and how far a point is from a line. Work out triangle and polygon areas, line–circle crossings and survey bearings. Answers stay exact, with fractions and simplified roots, and come with a graph and full working.

Choose a calculation

Enter points as (x, y). Fractions such as 1/3 and negative numbers are fine. Lines can be in any form, such as y = 2x + 1, 3x − 4y = 12 or x = 5.

How to use the calculator

Choose a calculation, then enter the points and lines it needs. Points are typed as (x, y), and the brackets are optional, so 2, −3 works too. Fractions such as 1/3, decimals and negative numbers are all fine. Lines can be typed in any form you would write on paper: y = 2x + 1, 3x − 4y = 12, y − 2 = 3(x + 1) or x = 5. The calculator turns them into standard form for you.

Results are exact wherever possible. Fractions stay as fractions, and square roots are simplified, so √52 is shown as 2√13, followed by a decimal. Each result also comes with a sketch on the coordinate plane and numbered working, so you can follow the method and check it against your own.

Distance, midpoint and slope from two points

d = √((x₂ − x₁)² + (y₂ − y₁)²) · M = ((x₁ + x₂)/2, (y₁ + y₂)/2) · m = (y₂ − y₁)/(x₂ − x₁)

The distance formula is Pythagoras’ theorem. The horizontal change Δx and the vertical change Δy are the two shorter sides of a right triangle, and the distance is its hypotenuse. For A(2, 3) and B(−4, 7), Δx = −6 and Δy = 4. The distance is √(36 + 16) = √52 = 2√13 ≈ 7.21. The midpoint is (−1, 5), and the slope is 4 ÷ (−6) = −2/3, so the line falls from left to right. The line through both points is 2x + 3y = 13.

To find a point part-way along a segment, use the section formula. The point that divides AB in the ratio m:n is ((n·x₁ + m·x₂)/(m + n), (n·y₁ + m·y₂)/(m + n)). The point one-third of the way from (1, 2) to (10, 8) uses the ratio 1:2 and is (4, 4). The midpoint is the special case 1:1.

Equations of a line

  • Slope-intercept form, y = mx + b: shows the slope m and where the line crosses the y-axis.
  • Point-slope form, y − y₁ = m(x − x₁): the quickest way to write a line through a known point. Through (3, −1) with slope 2/5, it gives y = (2/5)x − 11/5.
  • Standard form, ax + by = c: with whole numbers, 2x − 5y = 11 for the same line. It is handy for intercepts and for solving pairs of lines.
  • General form, ax + by + c = 0: used in the point-to-line distance formula.

A horizontal line has slope 0 and an equation like y = 4. A vertical line has an undefined slope, because Δx = 0, and an equation like x = 5. A vertical line cannot be written as y = mx + b, which is why the calculator always gives the standard form as well.

Parallel and perpendicular lines

Parallel lines have equal slopes. Perpendicular lines have slopes that multiply to −1, so a slope of 2/3 becomes −3/2. In standard form there is a shortcut. To get a perpendicular to ax + by = c, swap a and b and change one sign, giving bx − ay = k. Then find k by substituting your point. The perpendicular to 2x − 3y = 6 through (4, 1) is 3x + 2y = 14, because 3(4) + 2(1) = 14. The shortcut also handles vertical and horizontal lines, where the slope rule breaks down.

Distance from a point to a line

distance = |a·x₀ + b·y₀ + c| ÷ √(a² + b²)

This is the shortest distance, measured at right angles to the line. For the point (2, 4) and the line 5x − 12y + 3 = 0, the numerator is |10 − 48 + 3| = 35 and the denominator is √(25 + 144) = 13. The distance is 35/13 ≈ 2.69. The calculator also gives the foot of the perpendicular, which is the closest point on the line, and the mirror image of the point in the line. Both are useful for reflections in geometry and graphics.

Where two lines meet

Two lines in a plane either cross at exactly one point, never meet (parallel), or are the same line. To find the crossing point, solve the two equations together. For y = 2x − 1 and x + 3y = 11, substitute the first into the second: x + 3(2x − 1) = 11, so 7x = 14, x = 2 and y = 3. If the determinant a₁b₂ − a₂b₁ is zero, the slopes are equal. The calculator then tells you whether the lines are parallel and how far apart they are, or whether they are the same line. It also gives the angle between crossing lines. For more than two lines, or more unknowns, use the system of equations calculator.

Triangles from coordinates

Three points give a triangle, and its area comes straight from the coordinates. The shoelace formula, ½|(x_B − x_A)(y_C − y_A) − (y_B − y_A)(x_C − x_A)|, needs no heights or angles. If the result is zero, the points are collinear. Comparing squared side lengths classifies the triangle exactly, without rounding. For A(−2, 1), B(2, 4) and C(5, 0), AB² = 25, BC² = 25 and CA² = 50. Two sides are equal and 25 + 25 = 50, so the triangle is isosceles with a right angle at B, and its area is 12.5.

The calculator also finds the four classic centres. These are the centroid (the balance point), the circumcentre (the centre of the circle through all three corners), the incentre (the centre of the largest circle inside) and the orthocentre (where the altitudes cross). The centroid, circumcentre and orthocentre always lie on one straight line, called the Euler line.

Area of any polygon: the shoelace formula

The same idea extends to any polygon whose sides do not cross. List the corners in order around the edge and add up xᵢ·yᵢ₊₁ − xᵢ₊₁·yᵢ for each side, wrapping from the last corner back to the first. Half the absolute value is the area. Surveyors call this the area by coordinates method. A five-sided plot with corners at (0, 0), (40, 0), (52, 30), (20, 45) and (−5, 25) metres has an area of 1,832.5 m², about 0.18 hectares. The order matters: the points must go around the boundary, either clockwise or anticlockwise. If they jump across the shape, the sides cross and the result is wrong, so the calculator warns you.

Lines and circles

A circle with centre (h, k) and radius r has the equation (x − h)² + (y − k)² = r². Whether a line meets it depends on the distance d from the centre to the line. If d > r, the line misses. If d = r, it is a tangent that touches at one point. If d < r, it cuts the circle at two points. The line y = x + 1 is about 2.12 from the centre of the circle (x − 3)² + (y − 1)² = 16, which is less than the radius of 4. It crosses at ((3 ± √23)/2, (5 ± √23)/2). For radius, area and circle equations, see the circle calculator.

Bearings, eastings and northings

Surveying and navigation measure direction as a bearing, clockwise from north. A whole-circle bearing runs from 0° to 360°. A quadrant bearing such as N 35° E means start facing north and turn 35° towards east. Coordinates are given as eastings (x) and northings (y). Travelling a distance d on bearing θ changes them by ΔE = d·sin θ and ΔN = d·cos θ. These are the reverse of the usual maths convention, because the angle is measured from north rather than from the x-axis.

Starting at (500, 1000) and going 120 m on N 35° E reaches about (568.83, 1098.30). The back bearing, for the return trip, differs by 180°: S 35° W, or 215°. In the two-point mode, the calculator gives the bearing from A to B too, which surveyors call the inverse of a line.

Where coordinate geometry is used

  • Surveying and land: working out plot areas from corner coordinates, setting out points from a bearing and distance, and checking boundaries.
  • Construction and CAD: finding where walls or pipes meet, offsets from a centreline, and perpendicular clearances.
  • Graphics, games and robotics: collision checks, line-of-sight, reflections and paths that use distances and intersections.
  • Maps and GIS: distances and areas on a projected grid such as a national grid or UTM, where both axes use metres.
  • Exams: proving that a shape is a parallelogram or right triangle, finding equations of tangents and bisectors, and locating centres of triangles.

Tips and common mistakes

  • Subtract in the same order. Use (y₂ − y₁)/(x₂ − x₁), not (y₂ − y₁)/(x₁ − x₂), or the slope’s sign flips.
  • Watch the signs with negative coordinates. 3 − (−4) = 7, not −1. Brackets around negative numbers help.
  • Use the same units on both axes. Distance and area only make sense if x and y use the same unit.
  • Latitude and longitude are not x and y. They are angles on a curved Earth. Convert to a projected grid first, or use a great-circle distance tool.
  • Keep polygon corners in order. Go around the boundary once, without jumping across the shape.

Frequently asked questions

How do I find the equation of a line through two points?

Find the slope m = (y₂ − y₁)/(x₂ − x₁), then substitute one point into y − y₁ = m(x − x₁) and simplify. For (2, 3) and (−4, 7), m = −2/3, which gives 2x + 3y = 13. Choose the two-points mode to see every step.

How do I find the shortest distance from a point to a line?

Write the line as ax + by + c = 0 and use |a·x₀ + b·y₀ + c| ÷ √(a² + b²). The calculator also gives the closest point on the line, which is the foot of the perpendicular.

How do I check whether three points are collinear?

Work out the triangle area with the shoelace formula. If it is zero, the points lie on one line. In the triangle mode, the calculator tells you when the points are collinear.

How do I find the area of a shape from its coordinates?

Use the polygon mode and enter the corners in order, one per line. The calculator applies the shoelace formula and also gives the perimeter and the centre of area.

What is the slope of a vertical line?

It is undefined, because the run Δx is zero and you cannot divide by zero. A vertical line has an equation of the form x = k. It is perpendicular to any horizontal line, y = c.

Can I use these formulas with GPS coordinates?

Not directly. Latitude and longitude are angles, and degrees of longitude shrink towards the poles. Convert to a projected grid in metres, such as UTM, before working out distances, areas or bearings.

← All geometry calculators