ForHosting KIT · Developer Utilities

L4 and L5 Lagrange Point Geometry Calculator

This L4 and L5 geometry calculator converts one positive primary-secondary separation into the two triangular Lagrange-point positions.

● BetaFree · in your browser
Use it from WebAPIEmailTelegramApp soon

It uses a clear two-dimensional reference frame: the primary is at the origin, the secondary lies on the positive x-axis, and both triangular points are the same distance from each body as the bodies are from one another. The result gives Cartesian coordinates for the primary, secondary, L4, and L5, making the geometry ready for diagrams, simulations, lessons, and reproducible calculations.

Understand the coordinate frame before using the coordinates

The calculator fixes the primary body at x = 0 and y = 0, then places the secondary body at x equal to the supplied separation and y = 0. That convention turns an otherwise orientation-dependent question into a unique Cartesian answer. L4 is the vertex on the positive-y side of the primary-secondary line, corresponding to sixty degrees ahead in the chosen orientation, while L5 is its negative-y reflection, corresponding to sixty degrees behind. Both have an x-coordinate equal to half the separation. Their y-coordinate magnitude is the equilateral-triangle altitude: the separation multiplied by the square root of three and divided by two. The input has no prescribed physical unit. If the separation is in kilometres, every returned coordinate is in kilometres; if it is in astronomical units, every coordinate uses astronomical units. Keep one unit throughout your workflow, because this geometry operation does not label, infer, or convert units. It only preserves the scale supplied by the caller.

Interpret what this geometric result represents

L4 and L5 form equilateral triangles with the two massive bodies in the ideal circular restricted three-body model. This calculator returns those ideal triangle vertices, not a numerical orbit integration or an ephemeris. The primary and secondary therefore define a snapshot in a rotating, two-dimensional frame, and the returned points share the same separation from each endpoint. You can verify the construction directly: the distance from either triangular point to the primary equals the input separation, and the distance from that point to the secondary does too. The signs of the y-coordinates distinguish the two symmetric solutions. Which side is called ahead depends on the orientation convention of a larger simulation, so map positive y to the direction appropriate for your coordinate system before combining these values with other data. Masses are not requested because they do not change the equilateral vertex coordinates in this ideal geometry. They do matter for stability, dynamics, barycentric coordinates, and real trajectories, none of which this focused calculation claims to solve.

Use the output safely in diagrams and calculations

Start with a separation measured consistently, submit it as a finite positive number, and read the four returned position objects. The primary and secondary entries make the assumed baseline explicit, while the L4 and L5 entries can be plotted without reconstructing the reference frame. For a drawing, use equal scaling on both axes; unequal screen scales can make the equilateral triangles appear distorted even though the coordinates are correct. For a simulation that uses a barycentric origin, translate all four points by the offset required by that model after this calculation. For a baseline pointing in another direction, rotate every returned point through the desired angle. Translation and rotation preserve the equilateral geometry. A zero or negative separation is rejected because distinct bodies cannot define a triangle with such a baseline, and non-finite values are rejected because they cannot produce meaningful coordinates. The operation is deterministic and uses no network calls, current time, random values, body catalogs, or hidden constants beyond the exact square-root expression for an equilateral triangle.

Build an orbital-mechanics diagram

Generate consistent L4 and L5 plot coordinates from a known distance before adding labels, scale marks, or a rotation into the desired viewing frame.

Check a simulation setup

Compare triangular-point seed coordinates against a simple independent geometry result before introducing masses, velocities, perturbations, or numerical integration.

Teach equilateral Lagrange geometry

Show how one separation determines both symmetric vertices and verify that all three sides of each primary-secondary-point triangle have equal length.

What coordinate system does the calculator use?

It places the primary at (0, 0), the secondary at (separation, 0), L4 above the x-axis, and L5 below it.

What unit should I use for separation?

Any consistent length unit works. The returned x and y coordinates remain in that same unit.

Why are masses not required?

The ideal L4 and L5 triangle vertices depend on the primary-secondary separation, not their masses. Masses affect stability and barycentric placement, which are outside this geometry calculation.

Does this calculate a spacecraft trajectory?

No. It returns ideal geometric positions only; it does not calculate velocity, stability, perturbations, or an orbit over time.

Why does a non-positive separation fail?

A separation must be greater than zero to define two distinct endpoints and a non-degenerate equilateral triangle.

What does the API request cost?

Each API request costs $0.002; the same deterministic calculation can also run free in the browser.

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/lagrange-l4-l5-geometry

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/lagrange-l4-l5-geometry \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"separation":384400}'
{
  "separation": 384400
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "astro.lagrange_l4_l5_geometry",
  "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.

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.

Read the full KIT documentation →