Spherical segment calculator
Cut a sphere with two parallel planes and get the slice between them: on a sphere of radius 5, cuts at heights 1 and 4 give a segment 3 high, plus its volume, the curved band area and both circle radii. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Radius
- 5
- Height1
- 1
- Height2
- 4
- Segment height
- 3
- Volume
- 169.6460032938
- Lateral area
- 94.2477796077
- Base radius1
- 3
You enter radius R and the two plane positions height1 and height2, each required to lie on the diameter interval from zero through two R so that neither plane falls outside the ball; the engine returns the segment height as the absolute difference of those heights, the volume as the absolute difference of two spherical-cap volumes using one-third pi h squared times three R minus h, the lateral zone area as two pi R times the segment height, and the circular base radii at each cut as the square root of h times two R minus h. Formula strings ride along so a student or a log line can verify the identities without reading the source.
What a spherical segment calculator returns and why both cutting heights matter
A spherical segment is the solid portion of a ball cut by one or two parallel planes; when people talk about the curved side alone they often call it a spherical zone. This tool models the two-plane case by placing the sphere on a vertical diameter of length two R, measuring each cutting plane as a height from the bottom pole, and requiring both heights to stay inside the closed interval from zero to two R.
That convention matches tank gauges, blueprint sections, and textbook problems that locate planes by distance from a pole rather than by signed offset from the center. If you need full sphere volume, cone metrics, or torus surface area, use a tool dedicated to those problems; the search intent here is the spherical segment and zone from radius and two cutting heights and a clear answer or an honest error when a height lies outside the sphere.
How the closed forms are evaluated: cap volumes, zone area, and base radii
The cumulative spherical-cap volume from the bottom pole up to a height h is the standard one-third pi h squared times three R minus h, which is exact for every height on that diameter and reduces to the full ball volume four-thirds pi R cubed when h equals two R. Segment volume is the absolute difference of the two cap volumes, so the order of the cutting heights never flips the sign and equal heights correctly yield zero.
Lateral zone area is independent of where the band sits on the sphere: it is always two pi R times the absolute segment height, the famous property that a zone of given height has the same area no matter how high it rides on the ball. At each cutting plane the circular section has radius equal to the square root of h times two R minus h, zero at either pole and equal to R at the equator.
Optional precision only rounds the published fields; the internal solve always uses full double precision before that final rounding step.
What you can do with it
Homework and exam preparation
Compute spherical segment volume and zone lateral area from textbook radius and two cutting heights, and verify that heights outside the sphere are rejected.
Spherical tanks, domes, and liquid levels
Size liquid volume between two gauge heights in a spherical tank, or paint area on a spherical zone of known height, from known sphere radius and plane positions.
FAQ
What does the spherical segment calculator cost?
It is free in your browser on this page.
How is the segment volume computed?
Each cutting height defines a spherical cap from the bottom pole with V_cap(h) = (1/3) π h² (3R − h). Segment volume is the absolute difference of the two cap volumes.
Where do I measure the two cutting heights from?
From the bottom pole, along the vertical diameter. Each height must lie between 0 and twice the radius, the way tank gauges and blueprint sections place planes by their distance from a pole.
Why is the zone area the same wherever the band sits on the sphere?
Because the curved band area is always 2πR times the segment height. A band 3 units tall has the same area near the pole as around the middle of the ball.
What are the two base radii in the result?
They are the radii of the circles where each plane cuts the ball, the square root of h times (2R − h). On a sphere of radius 5, a cut at height 1 gives 3 and a cut at height 4 gives 4.8989794856.
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/geom/spherical-segment \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"radius":5,"height1":1,"height2":4}'const res = await fetch("https://api.kit.forhosting.com/geom/spherical-segment", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"radius": 5,
"height1": 1,
"height2": 4
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/geom/spherical-segment",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"radius": 5,
"height1": 1,
"height2": 4
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/geom/spherical-segment", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"radius":5,"height1":1,"height2":4}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"radius":5,"height1":1,"height2":4}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/geom/spherical-segment", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"radius": 5,
"height1": 1,
"height2": 4
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "geom.spherical_segment",
"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
When radius is missing or not positive, or when a cutting height lies outside the sphere, the tool returns invalid_input instead of a silent NaN. Through the API a successful request costs $0.002; validation failures are not charged.
What a spherical segment calculator returns and why both cutting heights matter
The response always echoes radius, height1, and height2, reports segment_height as the absolute difference of the two cuts, volume as the absolute difference of the two cumulative cap volumes, lateral_area as the zone surface two pi R times segment height, base_radius1 and base_radius2 as the radii of the circular sections at each plane, and formula strings for volume and lateral area so a student or a log line can verify the identity without reading the source. Missing radius or either height, non-finite values, a non-positive radius, or a height that lies outside the sphere all raise invalid_input with a message that names the failing field and, for out-of-range heights, states the allowed interval zero through two R. That discipline keeps automated tests stable, makes caching safe, and prevents a script from treating a plane that misses the ball as a real segment.
How the closed forms are evaluated: cap volumes, zone area, and base radii
The engine resolves radius from the field radius with aliases r and R, height1 from height1 with aliases h1, a, and lower, and height2 from height2 with aliases h2, b, and upper, requiring radius to be finite and strictly greater than zero and each height to be finite and inside the closed interval from zero to two times the radius. Pair the free browser run on this page with the priced API when you need the identical mathematical result inside an automated pipeline without re-implementing the cap-volume difference or the two-pi-R-h zone formula yourself.
Where spherical segment metrics fit in study, design, and code
Students meet the spherical segment when a textbook asks for the volume of a ball slice between two parallel planes, when an exam demands the lateral zone area for a given height, or when solid-geometry homework wants both the curved side and the solid volume before material or fluid estimates. Teachers can pre-generate answer keys that list volume and zone area for integer radii and cutting heights, and that refuse a height outside the sphere instead of printing NaN. Mechanical and civil design often needs the liquid volume in a partially filled spherical tank between two level gauges, the painted area of a spherical zone on a dome, or the capacity of a cap cut from a sphere; knowing that a requested height misses the ball is as valuable as the number itself. Surveying and CAD workflows place spherical segments as construction geometry, and game or simulation teams use volume and zone area for collision approximations, planetary slices, and procedural mesh sizing that should stay deterministic across platforms. On this page the work runs entirely in your browser; through the API each successful lookup costs $0.002, failed validation is not charged, and nothing is stored after the response returns. That split—free interactive exploration and a priced, identical API—matches the rest of the KIT tier-A catalog and lets you move from a classroom demo to an automated pipeline without changing the mathematical result. Pair it with other free geometry endpoints when you need cone volume, torus surface, or triangle solvers for a lab of deterministic tools, and with documentation that shows both cutting heights and the finished metrics so the numbers and the picture stay aligned for learners and reviewers. Whether you arrived searching for a spherical segment calculator or for spherical zone area from radius and height, the contract is the same: positive radius and two in-range cutting heights in, finite metrics or a clear invalid_input out.
Integration use cases
Deterministic geometry fixtures
Generate reproducible segment and zone metrics for unit tests, contest validators, and CI assertions without hand-rolled cap-volume difference logic.
Technical questions
What if a cutting height lies outside the sphere?
The handler returns invalid_input with a message that the height must lie between 0 and 2R (the diameter of the sphere).
Does lateral area depend on where the zone sits on the sphere?
No. Lateral zone area is always A = 2 π R |h2 − h1|, independent of the absolute positions of the two parallel planes.
Can I control rounding?
Yes. Set precision (aliases decimals, dp) to an integer from 0 to 15; the default is 10 decimal places on all numeric fields.