Cyfrifiadur
Canfod y pellter llinell- dde rhwng dau bwynt ar gylch.
Diweddaru canlyniadau wrth i chi deipio.
Am y cyfrifiadur hwn
This calculator finds the straight-line distance between two points (x₁, y₁) and (x₂, y₂) using the distance formula, and also reports the horizontal change (Δx), the vertical change (Δy), and the midpoint of the segment, with a plot of the two points.
The distance formula, d = √((x₂ − x₁)² + (y₂ − y₁)²), is simply the Pythagorean theorem applied to a grid: the horizontal and vertical gaps are the two legs of a right triangle and the distance is the hypotenuse. Between (0, 0) and (3, 4), Δx = 3 and Δy = 4, so d = √(3² + 4²) = √(9 + 16) = √25 = 5. Because the differences are squared, the order of the points does not change the result, and negative coordinates work fine.
This is the everyday tool for map distances, the length of a line segment, the magnitude of a vector, and nearest-neighbour comparisons in data. Any two points on a plane have exactly one straight-line distance between them.
Cwestiynau a ofynnir yn aml
Beth yw' r fformiwla pellter?
Mae d = √((x₂ − x₁)² + (y₂ − y₁)²). Ynghyd â (0,0) a (3,4) mae'r pellter yn √(9 + 16) = √25 = 5.
Sut mae'n perthyn i'r theorem Pythagoreaidd?
Mae'r bylchau llorweddol a fertigol yn ffurfio dau ben triongl ddeheuol, a'r pellter yw ei hypotenws - felly mae'r fformiwla pellter yn Pythagoras ar y grid.
Beth yw Δx a Δy?
Maent yn y gwahaniaethau llorweddol a fertigol rhwng y pwyntiau, x2 − x1 a y2 − y1 — y ddau goes o'r triongl degol tu ôl i'r pellter.
A ydy'r offeryn yn dangos y canol-bwyntiau?
Ie. Ynghyd â' r pellter mae' n ei roi i' r canol- bwynt, y cydweddiad yn union hanner ffordd rhwng y ddau bwynt.
A yw trefn y pwyntiau'n bwysig?
Na. Mae' r gwahaniaethau yn sgwâr, felly mae trosi' r ddau bwynt yn rhoi' r un pellter.
A all ymdrin â chyfesurynnau negyddol?
Ie. Mae unrhyw gydraniadau gwir yn gweithio, gan gynnwys negyddol a degol - mae'r sgwâr yn cadw pob pellter yn bositif.
API - defnyddio'r cyfrifiannell hwn o'r cod
Galw'r cyfrifiannell hwn fel diwedd-bwynt JSON rhad ac am ddim - nid oes angen allwedd. Anfonwch y gwerthoedd maes isod fel paramedrau ymholiad neu JSON. Anything you omit uses the same default this page is pre-filled with; an unknown parameter is a 400, never a silent zero. Darllen y dogfennaeth API lawn →
Diwedd
GET https://calculator.free/api/v1/distance-two-points/
curl
curl "https://calculator.free/api/v1/distance-two-points/?x1=0&y1=0&x2=3&y2=4"
JavaScript fetch()
const r = await fetch(
"https://calculator.free/api/v1/distance-two-points/?" + new URLSearchParams({
"x1": "0",
"y1": "0",
"x2": "3",
"y2": "4"
}));
const data = await r.json();
console.log(data.results);
Mae'r canlyniadau yn amcangyfrifon ar gyfer cyfarwyddyd cyffredinol yn unig, nid cyngor ariannol, meddygol na thrafodion treth.