ForHosting KIT · Science

Angular size calculator

The Sun, 1392000 km across and 149597870.7 km away, spans about half a degree on the sky. Enter any size and distance in the same unit and get the exact angle the object covers, with each step shown. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Physical size
1,392,000
Distance
149,597,870.7
You get
Diameter
1,392,000
Physical size
1,392,000
D
149,597,870.7
Angular diameter rad
0.0093048781

An angular size calculator turns an object's real-world diameter and its distance from the observer into the angle that object subtends on the sky. Enter a positive physical size and a positive distance in the same length unit; the tool returns the exact angular diameter θ equals two times arctangent of size over two times distance, expressed in radians, degrees, arcminutes, and arcseconds, plus a readable equation string and substitution steps. Students checking Sun and Moon homework, planetarium developers, game designers placing distant props, and unit-test authors all need that same deterministic number without a full astronomy stack.

What angular diameter means for size and distance

Angular diameter, also called angular size, is the angle subtended by the straight-line extent of an object as seen by an observer. If the object has linear diameter D and sits at distance d from the observer, geometry of the isosceles triangle from the eye to the two ends of the diameter gives the exact relation theta equals two times the arctangent of D over two d.

That formula is exact for a circular (or chord-based) silhouette when size and distance share the same length unit; it does not require converting kilometres to astronomical units as long as both inputs use the same scale. When D is much smaller than d, the half-angle is tiny and the small-angle approximation theta in radians approximately equals D over d becomes excellent, which is why many textbooks write theta approximately equal to size over distance for stars and distant planets.

For nearby or huge objects the approximation drifts, so this calculator always uses the full two-arctan form and only then converts radians to degrees, arcminutes, and arcseconds for display. Teachers should stress that angular size is not a property of the object alone: the Sun and the Moon have very different physical diameters, yet nearly the same angular diameter from Earth because the Moon is much closer.

The check path recomputes arctangent and degree conversion with the same fixed rounding used for published fields, so a successful response always ships with steps you can assert in tests or worksheets.

Practical tips, limits, and related searches

Use the same length unit for both inputs: convert one value if your source mixes kilometres with astronomical units. Prefer numbers rather than pre-formatted strings when you control the client; string numbers are accepted only when they match a strict finite numeric pattern. Classic checks include the Sun at roughly one point three nine two million kilometres diameter and one AU distance, which yields about half a degree or roughly thirty-two arcminutes, and a simplified Moon case with diameter and distance in kilometres that lands near the same angular size.

Prefer this capability when you already have linear size and distance and only need the subtended angle; if your source gives radius instead of diameter, double the radius first. Round-trip checks are easy: recompute two times atan of size over two distance, multiply by one hundred eighty over pi for degrees, multiply by sixty for arcminutes, and confirm the published fields match within the same twelve-decimal rounding.

What is angular size or angular diameter?

It is the angle an object subtends as seen by an observer. With physical size D and distance d (same unit), θ = 2·atan(D/(2·d)).

Do size and distance need the same units?

Yes. Any length unit works (m, km, AU, ly) as long as both fields use that same unit; the tool does not convert units.

Is this the small-angle approximation?

No. The primary formula is the exact two-arctan form. When size ≪ distance it agrees with θ ≈ size/distance in radians.

Is the angular size calculator free?

The browser tool is free and runs locally.

Why do the Sun and the Moon look about the same size?

Their physical diameters are very different, but the Moon is much closer to Earth. Angular size depends on both size and distance, so the two end up with nearly the same angular diameter in our sky.

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.

POSThttps://api.kit.forhosting.com/astro/angular-size

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.

curl -X POST https://api.kit.forhosting.com/astro/angular-size \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"size":1392000,"distance":149597870.7}'
{
  "size": 1392000,
  "distance": 149597870.7
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "astro.angular_size",
  "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.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_abs1e+36
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Zero or non-positive distance is rejected with invalid_input instead of inventing an infinite angle.

What angular diameter means for size and distance

Distance of exactly zero is undefined for this geometry—the half-ratio would diverge—so the API refuses non-positive distance rather than returning infinity or NaN.

How to call the API and what comes back

Send a JSON body with two required strictly positive finite numbers: size (aliases diameter, physical_size, D, linear_size) and distance (aliases dist, d, range, observer_distance). Absolute values must stay within the published limits so that the half-ratio and arctangent remain finite in IEEE double precision on the Worker and in the browser. On success the response echoes rounded size and distance under primary and alias keys, sets angular_diameter_rad and theta_rad to the angle in radians, angular_diameter_deg, angular_diameter_degrees, and theta_deg to degrees, angular_diameter_arcmin, angular_diameter_arcminutes, and theta_arcmin to arcminutes, angular_diameter_arcsec, angular_diameter_arcseconds, and theta_arcsec to arcseconds, formula to the string theta equals two atan of size over two distance, equation to a human-readable substitution line, units to a map of labels, message to a short English summary, and steps to an ordered array of given-values, formula, half-ratio, radian, degree, and arcunit lines. Failed validation—missing fields, non-finite numbers, values outside absolute limits, non-positive size, or zero or non-positive distance—returns invalid_input and is never charged. Pricing is a flat $0.002 per successful request with unit item and zero marginal unit price.

Practical tips, limits, and related searches

Keep ratios inside double range: absurdly large size with tiny distance still produces a finite angle approaching one hundred eighty degrees, but non-finite intermediates outside published limits are rejected. This landing targets people searching for an angular size calculator, angular diameter in degrees or arcminutes, or physical size to angle online; it is not a solid-angle tool, not a parallax or distance-modulus converter, not a plate-scale calculator for CCD pixels, and not a small-angle-only approximation library. Failed tasks that return invalid_input do not consume prepaid balance, which keeps exploratory scripts cheap when learners deliberately send zero distance.

Homework checks for Sun and Moon angular size

Students enter textbook diameters and distances and compare hand-written 2·atan(D/2d) in degrees and arcminutes against a deterministic JSON result before submitting.

Unit tests for rendering and planetarium code

Generate known-good angular diameters for distant props plus deliberate zero-distance rejections for coding kata expected values.

Game and sim world building

Procedural sky systems feed object size and observer distance into the API to set sprite scale and UI readouts without a full celestial mechanics stack.

What happens when distance is zero?

Zero distance is invalid for angular size. This tool returns invalid_input instead of infinity or NaN.

Read the full KIT documentation →