ForHosting KIT · Math

Section formula calculator

Locate the point that splits a segment in a given ratio: from A (2, 3) to B (8, 7) at 1:2, it sits a third of the way along, at x of 4 and y of 4 and a third. External division works too. 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
X1
2
Y1
3
X2
8
Y2
7
M
1
N
2
You get
X
4
Y
4.3333333333

Internally, P lies between A and B; externally, it lies on the line through A and B but outside the segment.

How the section formula finds the dividing point

For internal division the coordinates of P are x equals (m times x2 plus n times x1) divided by (m plus n), and y equals (m times y2 plus n times y1) divided by (m plus n). Geometrically, the weight m pulls toward B and the weight n pulls toward A, so a ratio of one to one yields the midpoint, and a ratio of one to two places P one-third of the way from A to B.

For external division the signs flip in the numerator and the denominator becomes m minus n: x equals (m times x2 minus n times x1) over (m minus n), and likewise for y. The external formula is likewise undefined when m equals n. Because both paths use only addition, subtraction, multiplication, and a single division, the result is deterministic, O(1), and free of trigonometric or iterative libraries.

Where section points show up in real work

Secondary-school and college analytic geometry courses constantly ask students to locate the point dividing a plotted segment in a given ratio; a trusted calculator with strict m-plus-n and m-minus-n checks speeds homework grading and removes spreadsheet mistakes where someone confuses internal with external formulas or accepts a division by zero.

Drafting, surveying, and simple GIS workflows that already project points into a local Cartesian plane need weighted stations along baselines—for example a stake that sits two parts toward B and one part toward A—before reporting or staking; having a shared numeric oracle keeps field notes and office scripts aligned on the same closed form.

Game, graphics, and CAD tutorials often place control points, joints, or spawn markers as section points along edges; the same internal formula with m:n equal to one to one is the midpoint used in subdivision and collision helpers. If you later need 3D section points, spherical geodesics, or parametric curves beyond a straight segment, treat those as separate search intents rather than overloading this coordinate section-formula landing.

Homework and exam checks

Locate the point that divides AB in ratio m:n and reject zero-denominator ratios with a clear error instead of Infinity.

What formulas does this calculator use?

Internal: x = (m x2 + n x1)/(m+n), y = (m y2 + n y1)/(m+n). External: x = (m x2 − n x1)/(m−n), y = (m y2 − n y1)/(m−n).

What happens if m + n equals zero for internal division?

Internal division is undefined when the sum of the ratio parts is zero.

Is the default mode internal or external?

Internal. Omit division or set it to "internal" for a point between A and B; set "external" for a point outside the segment.

What does it cost?

The browser tool is free and runs locally.

What is external division of a segment?

The point lies on the line through A and B but outside the segment. The formula subtracts instead of adding, divides by m minus n, and has no answer when m equals n.

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/geom/section-formula

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/geom/section-formula \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"x1":2,"y1":3,"x2":8,"y2":7,"m":1,"n":2}'
{
  "x1": 2,
  "y1": 3,
  "x2": 8,
  "y2": 7,
  "m": 1,
  "n": 2
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "geom.section_formula",
  "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.

The section formula is the closed-form answer to a classic coordinate-geometry question: given endpoints A(x1, y1) and B(x2, y2), where is the point P that divides AB in the ratio m to n? This calculator takes the six numbers x1, y1, x2, y2, m, and n, plus an optional division mode (internal by default or external), validates that every value is finite and that the denominator is non-zero, and returns the coordinates of P together with the normalized inputs and a method tag of section_formula. Students checking homework, teachers building deterministic graders, CAD and game tools that need weighted points along edges, and survey scripts working in a local plane all get the same pure result in the free browser tool and the paid API. Requests with m plus n equal to zero for internal division, or m equal to n for external division, fail with a clear invalid_input error instead of returning Infinity. No network calls, no random sampling, and no floating-point surprises beyond ordinary IEEE-754 arithmetic on the numbers you provide.

How the section formula finds the dividing point

Label the endpoints A(x1, y1) and B(x2, y2) and the positive or signed ratio m:n. External points lie on the line AB extended beyond the nearer endpoint; a common classroom check is A at (2, 3), B at (8, 7) with m:n equal to one to two externally, which lands at a point outside the segment rather than between the ends. The internal formula is undefined exactly when m plus n is zero, because that denominator vanishes; this service refuses that case with invalid_input and names the sum-zero rule so form clients can correct the ratio. Large coordinates or extreme ratios can still overflow IEEE-754 double range; when the computed point is non-finite the request fails with a clear overflow message instead of serializing Infinity into JSON.

What you send and what you get back

Optionally set division to internal or external; when omitted the service defaults to internal. After parsing, the service chooses the internal or external formula, checks that the denominator is non-zero, and returns the point. Wire the free browser tool for quick sanity checks, then call the identical contract from scripts when you need bulk evaluation without reimplementing the zero-denominator gates in every language. Provide six required finite numbers: x1 and y1 for endpoint A, x2 and y2 for endpoint B, and m and n for the ratio parts. Missing fields, empty strings, non-numeric text, NaN, and Infinity are rejected with invalid_input and are not charged. On success the JSON response includes x and y rounded for stable serialization, echoes the six normalized coordinates and ratio parts, sets division to the resolved mode, and sets method to the string section_formula so logs and teaching UIs can document the algorithm. Classic checks: A(2, 3), B(8, 7), m equals 1, n equals 2, internal yields P(4, 13/3); the same endpoints with m equals 1, n equals negative 1 and internal fails because m plus n is zero; external with equal m and n fails because m minus n is zero. API pricing is the published base of $0.002 per successful item.

Where section points show up in real work

Because this capability is a pure parse engine, failed validation does not consume balance and successful runs stay at $0.002 per item.

Baseline survey stations

From two projected endpoints and a field ratio, recover the planar station coordinates before staking or reporting.

Game and CAD edge helpers

Place a control point or joint along an edge using the same internal section formula in browser and API.

What if m equals n for external division?

External division fails with invalid_input when m − n is zero (equal ratio parts), because the denominator vanishes.

Read the full KIT documentation →