{"success":true,"version":"v1","request":{"tool":"get_calculator_schema","calculator_id":"distance-2d"},"result":{"entity_type":"calculator","id":"distance-2d","calculator_id":"distance-2d","canonical_url":"https://tttkmbb.com/math/distance-2d","name":"Distance Between Two Points Calculator","title":"Distance Between Two Points Calculator – Euclidean Distance and Midpoint in 2D","category":"math","category_name":"Math","tool_name":"calculate_distance_2d","featured_mcp_tool":false,"description":"Computes the straight-line (Euclidean) distance between two points in the plane, their midpoint, the coordinate differences and the Manhattan distance.","use_when":"You have two (x, y) coordinates and need the distance between them or the point halfway between them.","do_not_use_when":"You need the slope or equation of the line through the points (use slope) or the third side of a right triangle from two sides (use pythagorean).","inputs":[{"name":"x1","label":"x₁","type":"number","required":true,"description":"x-coordinate of the first point.","example":1},{"name":"y1","label":"y₁","type":"number","required":true,"description":"y-coordinate of the first point.","example":2},{"name":"x2","label":"x₂","type":"number","required":true,"description":"x-coordinate of the second point.","example":3},{"name":"y2","label":"y₂","type":"number","required":true,"description":"y-coordinate of the second point.","example":6}],"outputs":[{"name":"distance","label":"Distance","type":"number","decimals":6,"description":"√((x₂ − x₁)² + (y₂ − y₁)²)."},{"name":"midpoint_x","label":"Midpoint x","type":"number","decimals":6,"description":"(x₁ + x₂) / 2."},{"name":"midpoint_y","label":"Midpoint y","type":"number","decimals":6,"description":"(y₁ + y₂) / 2."},{"name":"midpoint","label":"Midpoint","type":"string","decimals":4,"description":"The midpoint as a coordinate pair, e.g. '(2, 4)'."},{"name":"delta_x","label":"Δx","type":"number","decimals":6,"description":"x₂ − x₁."},{"name":"delta_y","label":"Δy","type":"number","decimals":6,"description":"y₂ − y₁."},{"name":"manhattan_distance","label":"Manhattan distance","type":"number","decimals":6,"description":"|Δx| + |Δy|: the grid (taxicab) distance."}],"input_schema":{"type":"object","properties":{"x1":{"description":"x-coordinate of the first point.","type":"number","examples":[1]},"y1":{"description":"y-coordinate of the first point.","type":"number","examples":[2]},"x2":{"description":"x-coordinate of the second point.","type":"number","examples":[3]},"y2":{"description":"y-coordinate of the second point.","type":"number","examples":[6]}},"additionalProperties":false,"required":["x1","y1","x2","y2"]},"output_schema":{"type":"object","properties":{"distance":{"description":"√((x₂ − x₁)² + (y₂ − y₁)²).","type":"number"},"midpoint_x":{"description":"(x₁ + x₂) / 2.","type":"number"},"midpoint_y":{"description":"(y₁ + y₂) / 2.","type":"number"},"midpoint":{"description":"The midpoint as a coordinate pair, e.g. '(2, 4)'.","type":"string"},"delta_x":{"description":"x₂ − x₁.","type":"number"},"delta_y":{"description":"y₂ − y₁.","type":"number"},"manhattan_distance":{"description":"|Δx| + |Δy|: the grid (taxicab) distance.","type":"number"}}},"formula":"distance = √((x₂ − x₁)² + (y₂ − y₁)²); midpoint = ((x₁ + x₂)/2, (y₁ + y₂)/2); manhattan = |x₂ − x₁| + |y₂ − y₁|","sources":[{"name":"Wikipedia – Euclidean distance","url":"https://en.wikipedia.org/wiki/Euclidean_distance","type":"reference","retrieved_at":"2026-09-23"},{"name":"Wikipedia – Midpoint","url":"https://en.wikipedia.org/wiki/Midpoint","type":"reference","retrieved_at":"2026-09-23"},{"name":"Wolfram MathWorld – Distance","url":"https://mathworld.wolfram.com/Distance.html","type":"reference","retrieved_at":"2026-09-23"}],"freshness":{"type":"static","max_age_seconds":null,"note":"Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output."},"examples":[{"name":"(0, 0) to (3, 4)","inputs":{"x1":0,"y1":0,"x2":3,"y2":4},"expected":{"distance":5,"midpoint_x":1.5,"midpoint_y":2,"midpoint":"(1.5, 2)","delta_x":3,"delta_y":4,"manhattan_distance":7},"url":"https://tttkmbb.com/api/v1/calculate/distance-2d?x1=0&y1=0&x2=3&y2=4"},{"name":"(1, 2) to (4, 6)","inputs":{"x1":1,"y1":2,"x2":4,"y2":6},"expected":{"distance":5,"midpoint_x":2.5,"midpoint_y":4,"midpoint":"(2.5, 4)","manhattan_distance":7},"url":"https://tttkmbb.com/api/v1/calculate/distance-2d?x1=1&y1=2&x2=4&y2=6"}],"faq":[{"q":"Does the order of the points matter?","a":"Not for the distance or midpoint. Δx and Δy are signed (second minus first), so they flip sign if the points are swapped."},{"q":"Can I use this for GPS coordinates?","a":"Only for very short distances. Latitude/longitude lie on a sphere; use the haversine formula for geographic distances."}],"tags":["distance between two points","distance formula","midpoint","euclidean distance","coordinates"],"related":[{"calculator_id":"slope","reason":"Slope and equation of the line through the points."},{"calculator_id":"pythagorean","reason":"The distance formula is the Pythagorean theorem applied to Δx and Δy."},{"calculator_id":"right-triangle","reason":"Full right-triangle solver."}],"links":{"html":"https://tttkmbb.com/math/distance-2d","markdown":"https://tttkmbb.com/math/distance-2d.md","json":"https://tttkmbb.com/math/distance-2d.json","api":"https://tttkmbb.com/api/v1/calculate/distance-2d","schema":"https://tttkmbb.com/api/v1/calculators/distance-2d","openapi":"https://tttkmbb.com/openapi.json","mcp":"https://tttkmbb.com/mcp"},"version":"v1","updated_at":"2026-09-23"},"timestamp":"2026-09-23T23:26:17Z","next_actions":[{"tool":"run_calculator","calculator_id":"distance-2d","reason":"Run Distance Between Two Points Calculator with the inputs above."}],"links":{"markdown":"https://tttkmbb.com/math/distance-2d.md"}}