Triangle perimeter from vertices
The triangle with corners (0, 0), (3, 0) and (0, 4) has sides 3, 5 and 4 and a perimeter of 12. Enter the coordinates of three points to get each side and the total, with a check that they really form a triangle. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- X1
- 0
- Y1
- 0
- X2
- 3
- Y2
- 0
- X3
- 0
- Y3
- 4
- Perimeter
- 12
- Side ab
- 3
- Side bc
- 5
- Side ca
- 4
When a triangle is given by three Cartesian vertices rather than by named side lengths, the perimeter is the sum of the three Euclidean distances between those points. This calculator accepts the six finite coordinates of vertices A, B, and C, checks that the triple is not collinear, and returns the closed perimeter together with the three side lengths and a method tag.
How the three edge lengths become a perimeter
Label the three vertices in any order as (x1, y1), (x2, y2), and (x3, y3). The three edges of the triangle are the planar Euclidean distances between consecutive pairs. The length from the first vertex to the second is the square root of (x2 minus x1) squared plus (y2 minus y1) squared; the length from the second to the third uses the same hypot formula on that pair; and the closing edge returns from the third vertex to the first.
The perimeter is the sum of those three lengths. Because hypot is even in each difference, reversing the listing of the vertices does not change any length and therefore does not change the perimeter: winding order is irrelevant for this quantity. Before the sum is accepted, the calculator evaluates the shoelace expression x1 times (y2 minus y3) plus x2 times (y3 minus y1) plus x3 times (y1 minus y2).
That quantity is twice the signed area of the triple. Classic classroom checks include the right triangle with vertices at (0, 0), (3, 0), and (0, 4), whose sides are 3, 4, and 5 and whose perimeter is 12, and the isosceles case (0, 0), (2, 0), (1, 1), whose base is 2 and whose equal legs are each the square root of 2. The path is deterministic, constant time, and free of trigonometric libraries.
Where a vertex-based triangle perimeter shows up in real work
Secondary-school and college analytic geometry courses constantly ask students to find the perimeter of a triangle given three plotted points; a trusted calculator with a strict collinear check speeds homework grading and removes spreadsheet mistakes where someone adds the three hypotenuses after swapping a coordinate or accepts a collinear triple as a valid figure.
Drafting, surveying, and simple GIS workflows that already project points into a local Cartesian plane need the planar perimeter of three-corner parcels before staking or ordering fence and trim, and a shared numeric oracle keeps field notes and office scripts aligned on the same edge-sum path. Game, graphics, and CAD tutorials often store mesh faces as triples of two-dimensional screen or world coordinates; the perimeter answer feeds collision proxies, UV density checks, and level-of-detail heuristics without building a full computational-geometry stack.
If you later need spherical length on the globe, a semiperimeter from three already-known side lengths, polygon perimeter for more than three vertices, or triangle area from the same coordinates, treat those as separate search intents rather than overloading this triangle-with-vertices landing.
What you can do with it
Homework and exam checks
Compute triangle perimeter from plotted vertices and reject collinear triples with a clear error instead of a silent degenerate sum.
Local-plane survey parcels
From three projected corner coordinates, recover planar perimeter before reporting, staking, or ordering fence for a triangular lot.
FAQ
How is the perimeter of a triangle with vertices computed?
The three Euclidean distances |AB|, |BC|, and |CA| are summed.
What happens if the three vertices are collinear?
Collinear points do not form a triangle, so a degenerate walk along the line is not returned as a successful perimeter.
Does the order of the three vertices change the result?
No. Distance is symmetric, so listing the vertices clockwise or counterclockwise yields the same three lengths and the same perimeter.
Are the coordinates two-dimensional only?
Yes. This tool expects planar Cartesian x and y values. It does not compute 3D space-triangle perimeter or geographic great-circle length.
What does the triangle-perimeter calculator cost?
The browser tool is free and runs locally.
Related tools
For developers — API access
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.
API endpoint
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.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/math/perimeter-of-a-triangle-with-vertices \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"x1":0,"y1":0,"x2":3,"y2":0,"x3":0,"y3":4}'const res = await fetch("https://api.kit.forhosting.com/math/perimeter-of-a-triangle-with-vertices", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"x1": 0,
"y1": 0,
"x2": 3,
"y2": 0,
"x3": 0,
"y3": 4
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/math/perimeter-of-a-triangle-with-vertices",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"x1": 0,
"y1": 0,
"x2": 3,
"y2": 0,
"x3": 0,
"y3": 4
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/math/perimeter-of-a-triangle-with-vertices", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"x1":0,"y1":0,"x2":3,"y2":0,"x3":0,"y3":4}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"x1":0,"y1":0,"x2":3,"y2":0,"x3":0,"y3":4}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/math/perimeter-of-a-triangle-with-vertices", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"x1": 0,
"y1": 0,
"x2": 3,
"y2": 0,
"x3": 0,
"y3": 4
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "math.perimeter_of_a_triangle_with_vertices",
"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.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Collinear triples that would collapse the figure to a line segment, and any coordinate that is missing, NaN, or infinite, fail with invalid_input instead of a silent zero that looks like a successful solve. There are no network calls, no random samples, and no date stamps: only IEEE-754 arithmetic on the six numbers you provide.
How the three edge lengths become a perimeter
When it is exactly zero the three points lie on a single straight line, the figure is not a triangle, and the request is rejected with invalid_input rather than returned as a successful degenerate walk of two times the longest segment. Large coordinates can still overflow the IEEE-754 double range; when an edge length or the sum is non-finite the request fails with a clear overflow message instead of returning Infinity in JSON.
What you send and what you get back
Provide six required finite numbers: x1 and y1 for the first vertex, x2 and y2 for the second, and x3 and y3 for the third. After parsing, the service computes the three hypot lengths, sums them, and checks that the shoelace area is a non-zero finite number; if the three points are collinear the error message states that the vertices are collinear and asks for a non-degenerate triple. Example checks: zero, zero, three, zero, zero, four yields perimeter twelve with sides three, five, and four; zero, zero, one, one, two, two fails as collinear; a missing y3 fails naming that field. Use the free browser tool for a quick sanity check, then call the identical contract from scripts when you need bulk evaluation of coordinate-based perimeters without reimplementing the collinear gate in every language. Missing fields, empty strings, non-numeric text, NaN, and Infinity are rejected with invalid_input naming the field and are not charged. On success the JSON response returns perimeter rounded for stable serialization, the three side lengths side_ab, side_bc, and side_ca, the six normalized coordinates, and method set to the string euclidean_edge_sum so logs and teaching interfaces can document the algorithm. API pricing is the published base of $0.002 per successful item.
Where a vertex-based triangle perimeter shows up in real work
Because this capability is a pure parse engine, failed validation does not consume balance and successful runs stay at $0.002 per item.
Integration use cases
Game and CAD face helpers
Turn three 2D vertex pairs into a positive perimeter for mesh diagnostics, using the same Euclidean edge sum in browser and API.