calculator.onl
Categories50

Midpoint and internal division of a line segment

Find the midpoint and the point that divides a straight segment in a chosen ratio. Move its endpoints or change the ratio to see the division on the coordinate plane.

Interactive illustration

Keep the endpoints at (0, 0) and (8, 4). Switch AP : PB from 1 : 1 to 3 : 1 and follow point P.

ABPP (4, 2)
The x coordinate of A locates the starting end horizontally. If the origin lies to its right on an ordinary Cartesian drawing, keep the minus sign from the drawing.

The y coordinate of A fixes its vertical position. A rail that starts below the origin can have a negative y coordinate even when its physical length is positive.

Enter the x coordinate of B in the same frame as A. For a vertical segment both x coordinates agree and P keeps that shared coordinate for every permitted ratio.

Enter the y coordinate of B. Matching y values give a horizontal segment, which makes the effect of changing the ratio particularly easy to check by eye.

The first number counts parts from A to P. A larger first number, with the second fixed at a positive value, brings P closer to B.

The second number counts the remaining parts from P to B. Both numbers can be scaled by the same positive factor without moving P.

Updates as you type

Use a dot or comma for decimals. No thousands separators.

YOUR RESULT

P coordinate · x

4

Calculated from your inputs

P coordinate · y2
Midpoint · x4
Midpoint · y2
Length AP4.4721

Calculations run in your browser.
UNDERSTAND THE RESULT

A little context. A clearer answer.

↑ Back to calculator

When this calculator is useful

Suppose a bracket must sit three quarters of the way along a diagonal rail. Its location on a drawing needs two coordinates even though the instruction gives a single fraction. Mark one end A and the other B, enter their coordinates, then give three parts to AP and one part to PB. The moving point P marks the bracket. The midpoint stays visible as a reference, so you can tell which end is closer before transferring the dimensions.

The calculation uses the fraction t = m/(m + n). Start at A and add t times each coordinate difference from A to B. The same t must be used horizontally and vertically to keep P on the line. The midpoint uses t = 0.5 regardless of the two chosen ratio entries.

The length output applies the Pythagorean theorem to the horizontal and vertical differences and then takes the selected fraction of the full distance. If the inputs are in millimetres, AP is in millimetres. When reading a screen capture, coordinates in pixels produce a distance in pixels until you apply a known scale.

What to enter

InputWhat it meansExample value
A · xThe x coordinate of A locates the starting end horizontally. If the origin lies to its right on an ordinary Cartesian drawing, keep the minus sign from the drawing.0
A · yThe y coordinate of A fixes its vertical position. A rail that starts below the origin can have a negative y coordinate even when its physical length is positive.0
B · xEnter the x coordinate of B in the same frame as A. For a vertical segment both x coordinates agree and P keeps that shared coordinate for every permitted ratio.8
B · yEnter the y coordinate of B. Matching y values give a horizontal segment, which makes the effect of changing the ratio particularly easy to check by eye.4
AP · partsThe first number counts parts from A to P. A larger first number, with the second fixed at a positive value, brings P closer to B.1
PB · partsThe second number counts the remaining parts from P to B. Both numbers can be scaled by the same positive factor without moving P.1

How the calculation works

  1. Enter the coordinates of the two ends exactly as marked on the drawing. Keep the signs on any negative coordinates and use the same origin for both points. Check the labelled markers before setting the ratio.
  2. Give AP and PB their relative numbers of parts. For a point one third of the way from A, enter one part for AP and two for PB. The total of the parts is the denominator of the fraction travelled.
  3. Read the two coordinates of P together. Use the midpoint coordinates for a halfway check and the length AP if the workshop dimension is a distance along the segment. Change one ratio value to watch which way the point travels.
The formulaP = A + [m/(m+n)](B−A)

A worked example

The rail from A at (0, 0) to B at (8, 4) has its midpoint at (4, 2). Equal parts put P there. With three parts followed by one, travel through three quarters of the horizontal displacement of 8 and three quarters of the vertical displacement of 4. P lands at (6, 3). The full length is √80, so AP is three quarters of √80, approximately 6.7082 units. Its horizontal projection of 6 units is a different measurement.

Example you can load

What to enter
Result for this example · P coordinate · x4

This is a fixed example; changing the form above does not change these numbers.

Assumptions & limits

The model uses a flat Cartesian plane with the same unit on both axes. It divides the straight segment joining the endpoints. A bent rail, a road with several turns or a long route described by latitude and longitude has a different length along its surface. For coordinates taken from a map or an image, first identify its coordinate system and the unit represented by each axis.

Frequently asked questions

What happens if I change the order of the endpoints?

The midpoint keeps the same coordinates. The ratio is read from the new starting end. To identify the original physical point after exchanging A and B, also exchange the two ratio entries. With unequal parts, changing only the endpoints places P at the corresponding point on the other side of the midpoint.

Can the selected point be exactly at an end?

Yes. Zero parts for AP with a positive second entry place P at A. A positive first entry and zero for PB place P at B. Two zeros provide no total to divide. If the endpoints themselves coincide, every permitted ratio returns that one location and AP has zero length.

How do I check a result in another quadrant?

Try A at (−6, 2) and B at (2, −2) with one part followed by three. The displacement is (8, −4). A quarter of it is (2, −1), giving P at (−4, 1). Both coordinates lie between their endpoint values, as they must for an internal division.