ForHosting KIT · Math

Collinear points checker

Check whether three points lie on one straight line: (0, 0), (1, 1) and (2, 2) do, because the triangle they form has zero area. Vertical lines work too, since no slopes are involved. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
X1
0
Y1
0
X2
1
Y2
1
X3
2
Y3
2
You get
Twice signed area
0

Three points in the plane are collinear when a single straight line passes through all of them. Students checking homework, GIS scripts validating vertices, CAD pipelines detecting degenerate triangles, and exam generators all need a fast, deterministic answer rather than a floating sketch. This collinear points checker accepts the six coordinates of points A, B, and C, evaluates the cross product of vectors AB and AC (equivalently twice the signed triangle area), and reports whether that value is zero.

What collinearity means and how the cross-product test works

Two distinct points always determine a unique line. A third point C is collinear with A and B when it lies on that same line. Algebraically, the vectors from A to B and from A to C are parallel, so their two-dimensional cross product is zero: (x2 minus x1) times (y3 minus y1) minus (x3 minus x1) times (y2 minus y1) equals zero.

That quantity is also twice the signed area of triangle ABC from the shoelace formula; zero area means the three vertices do not span a triangle and therefore sit on one line. When any two points coincide, or when all three share the same coordinates, the cross product is still zero and the capability reports collinear equals true, matching the geometric view that degenerate triples still lie on a line (in fact on infinitely many).

When the points form a genuine triangle the absolute value of the cross product is positive and collinear equals false.

Where a collinear points checker earns its keep

Classroom and tutoring platforms use a collinear points checker so learners can verify homework triples without slope arithmetic that fails on vertical segments. Exam and LMS auto-graders need a deterministic oracle that marks collinear versus non-collinear items consistently and rejects garbage coordinates instead of silently coercing them. CAD and mesh tools detect zero-area faces before triangulation.

Failed validation is not billed.

Classroom and homework checks

Let students submit three coordinate pairs and verify whether the points are collinear without slope formulas that break on vertical lines.

Exam and LMS auto-grading

Mark collinearity items with a deterministic oracle that rejects non-numeric coordinates and never invents floating answers.

GIS and CAD degeneracy checks

Detect collinear or coincident vertices in polylines and mesh faces before area, triangulation, or export steps fail.

What if two points are the same?

Coincident points make the cross product zero, so collinear is true. Geometrically they still lie on a common line.

What happens with non-numeric coordinates?

Missing, empty, NaN, Infinity, and non-numeric strings are rejected and not billed.

Why not use slopes to test collinearity?

Slope comparisons fail or need special cases when a segment is vertical (infinite slope). The cross-product test works for every orientation without division.

How does the checker decide if points are on a line?

It multiplies the gaps from the first point to the other two crosswise and subtracts, which gives twice the area of their triangle. A result of zero means there is no triangle, so the three points share a line.

Does it give the slope or the equation of the line?

No. It only answers yes or no and shows the value it used, twice the signed area. For a slope, a line equation or a drawing, pair the answer with another tool or your own plot.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/geom/collinear-points

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/geom/collinear-points \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"x1":0,"y1":0,"x2":1,"y2":1,"x3":2,"y3":2}'
{
  "x1": 0,
  "y1": 0,
  "x2": 1,
  "y2": 1,
  "x3": 2,
  "y3": 2
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "geom.collinear_points",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Non-numeric or missing coordinates fail with invalid_input and are not billed.

What collinearity means and how the cross-product test works

The endpoint rounds the twice-signed-area field to twelve decimal places for stable machine comparison across runtimes, so goldens and client assertions stay byte-stable without inventing a fuzzy epsilon policy that would surprise graders. This is pure coordinate geometry: no slopes that break on vertical lines, no divisions that fail when A equals B, and no dependency on a computer-algebra system.

Input contract, response shape, and error behaviour

Pair the response with your own plot if you need a sketch; this capability only decides collinearity and does not emit SVG, slopes, or line equations. POST a JSON body with six required finite numbers: x1 and y1 for the first point, x2 and y2 for the second, x3 and y3 for the third. Each field may arrive as a JSON number or as a numeric string; missing fields, empty strings, NaN, Infinity, and non-numeric text fail with invalid_input naming the field, and those failures do not consume balance. On success the body echoes the six coordinates (rounded for stability), a boolean collinear, the numeric twice_signed_area used in the test, and method set to cross_product so clients can document the algorithm next to the answer. Example: points (0,0), (1,1), and (2,2) yield collinear true and twice_signed_area zero because they lie on the line y equals x. Points (0,0), (1,0), and (0,1) yield collinear false and twice_signed_area equal to one because they form a right triangle of area one half. For line equations from two points or triangle area from three vertices, use the sibling geometry endpoints; this page exists for the search intent of checking whether three points are collinear.

Where a collinear points checker earns its keep

GIS and mapping pipelines flag degenerate polylines when intermediate vertices collapse onto a segment; a tiny parse API avoids pulling a full geometry library for a six-number test. Keep requests small, pin the rounded twice_signed_area in tests, and you get reproducible collinearity answers for homework, edge workers, and CI without standing up symbolic math infrastructure of your own.

How do I check if three points are collinear?

Send finite numbers x1,y1,x2,y2,x3,y3. The API returns collinear true when the cross product (x2−x1)(y3−y1)−(x3−x1)(y2−y1) is zero, otherwise false.

What does the collinear points checker cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.

Read the full KIT documentation →