Catenary curve height calculator
Find how high a hanging cable sits at any distance from its lowest point: with a curve parameter of 10, the height 5 units out is 11.27626. At the vertex the height equals the parameter itself, and both sides are symmetric. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- A
- 10
- X
- 5
- Height
- 11.27626
A catenary is the curve a perfectly flexible, uniform chain or cable assumes when it hangs under its own weight between two supports. Its shape is a hyperbolic cosine: y = a·cosh(x/a), where a is the curve parameter. This calculator returns the vertical height of the curve at any horizontal position x from the vertex, given the curve parameter a.
How the catenary formula works
The catenary is the equilibrium shape of a hanging cable whose weight is distributed uniformly along its length. Written with the vertex at the origin, its equation is y = a·cosh(x/a), where cosh is the hyperbolic cosine and a is the curve parameter, sometimes called the catenary constant. The parameter a has a direct physical meaning: it is the ratio of the horizontal tension in the cable to its weight per unit length, and it equals the height of the vertex above the curve's directrix.
A large a means a shallow, tightly tensioned curve; a small a means a deep sag. To find the height at a point, this tool divides the horizontal position x by a, applies the hyperbolic cosine and multiplies by a again. Because cosh is an even function, the result is symmetric: the height at x and at minus x is identical.
Where a catenary height is used
Catenary geometry appears anywhere a cable, chain or flexible line hangs under gravity. Structural engineers use it to estimate the profile of suspension bridge main cables before the deck load flattens them into a parabola, and to set the sag and clearance of overhead power lines, where the height at a given span position determines safe distance from ground, vegetation and traffic. Naval and offshore work uses the same curve for anchor chains and mooring lines, where the height along the span relates to the tension transmitted to the anchor.
Architects encounter the inverted catenary in vaults and arches, since a hanging chain flipped upside down is the pure-compression form that Gaudí exploited; checking the curve's ordinate at a station tells you where the arch surface must pass. In education, the catenary is the standard counterexample to the intuition that a hanging rope is a parabola, so a quick numeric evaluator is handy for homework and demonstrations.
In each case the workflow is the same: measure or choose the parameter a from the sag, then evaluate the height wherever you need it.
What you can do with it
Overhead line clearance
Given the cable parameter from the design sag, compute the wire height at any span position to check ground clearance.
Mooring and anchor chains
Evaluate the catenary ordinate along a mooring line to estimate geometry and clearance to the seabed or hull.
FAQ
What is the curve parameter a?
It is the catenary constant: horizontal tension divided by weight per unit length.
Can x be negative?
Yes. cosh is even, so the height at x and at -x is the same; the sign only states which side of the vertex you are on.
Is the result deterministic?
Yes. It is one Math.cosh evaluation with a single half-up rounding, no network, randomness or clock, so identical inputs give byte-identical outputs.
Is a hanging chain shaped like a parabola?
No. A chain or cable hanging under its own weight forms a catenary, a hyperbolic cosine curve. It only flattens toward a parabola when a load is spread along it, as the deck does to the main cables of a suspension bridge.
Where is the catenary curve used in practice?
In overhead power lines, to check the wire height and ground clearance at a point of the span; in anchor and mooring chains; in suspension bridge cables; and, turned upside down, in arches and vaults like the ones Gaudí built.
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/catenary-curve \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"a":10,"x":5}'const res = await fetch("https://api.kit.forhosting.com/math/catenary-curve", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"a": 10,
"x": 5
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/math/catenary-curve",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"a": 10,
"x": 5
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/math/catenary-curve", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"a":10,"x":5}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"a":10,"x":5}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/math/catenary-curve", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"a": 10,
"x": 5
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "math.catenary_curve",
"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
Inputs are validated before any arithmetic, and invalid payloads fail with an invalid_input error instead of a silent wrong number.
How the catenary formula works
At x = 0 the height equals exactly a, since cosh(0) is 1.
Inputs, validation and rounding
The field x is the horizontal position measured from the vertex and may be any finite number, positive, negative or zero. The optional field decimals controls how the height is rounded; it defaults to 6 and must be an integer between 0 and 12. The tool accepts a small JSON object with two required fields and one optional one. The field a is the curve parameter and must be a finite number strictly greater than zero; zero, negative values, missing values and non-numeric payloads all raise an invalid_input error before any arithmetic happens, because a catenary with a non-positive parameter has no physical or mathematical meaning in this model. Rounding is half-up, applied exactly once to the raw IEEE result, which avoids the classic 0.1 + 0.2 surprises that banker's or repeated rounding would introduce when outputs are compared byte to byte across machines. The response echoes both inputs alongside the computed height so automated pipelines can verify which request produced which answer. Failed jobs raise invalid_input and are not billed.
Integration use cases
Teaching and homework
Contrast a hanging chain with a parabola by evaluating y = a·cosh(x/a) at chosen stations, with pinned golden examples.
Technical questions
Why does a non-positive a fail?
A catenary with a zero or negative parameter is not a hanging-cable equilibrium shape, so the input is rejected with invalid_input.
How much does the API cost?
The browser widget is free; the API starts at $0.002 per call, and failed jobs are not billed.