Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Distance and Midpoint between Complex Numbers


Complex Distance & Midpoint

|z₁ − z₂| is the distance, (z₁ + z₂)/2 is the midpoint
ReIm-5−5i-4−4i-3−3i-2−2i-1−1i11i22i33i44i55iΔa = 5Δb = 2d = 5.39Mz₁z₂
z₁
-2 + i
z₂
3 + 3i
Distance |z₁ − z₂|
5.39
Midpoint (z₁ + z₂) / 2
0.50 + 2i
Distance Step-by-Step
z₁ − z₂ = (-2 + i) − (3 + 3i) = -5 − 2i
|z₁ − z₂| = √(Δa² + Δb²)
= √(5² + 2²)
= √(25 + 4)
= √(29)
= 5.39
Midpoint Step-by-Step
M = (z₁ + z₂) / 2
= ((-2 + i) + (3 + 3i)) / 2
= (1 + 4i) / 2
= 0.50 + 2i
Key Ideas
The distance between two complex numbers is |z₁ − z₂| = √((a₁−a₂)² + (b₁−b₂)²). It is the same Euclidean distance formula from coordinate geometry — the Argand plane is just the xy-plane relabeled.
The right triangle shows the horizontal difference Δa = |a₁−a₂| and vertical difference Δb = |b₁−b₂|. The distance is the hypotenuse. Pythagoras at work.
The midpoint is (z₁+z₂)/2 — average the real parts, average the imaginary parts. It is the point equidistant from both z₁ and z₂ along the segment connecting them.
The dashed circle is centered at z₁ with radius |z₁−z₂|. Every point on this circle is the same distance from z₁ as z₂ is. The equation |z − z₁| = r describes a circle of radius r centered at z₁.
When z₂ = 0 (the origin), the distance |z₁ − 0| = |z₁| is just the modulus. Distance generalizes modulus to any two points, not just from the origin.
Everything at once: legs 5 and 2, hypotenuse √29, midpoint at 0.5 + 2i. Learn more about the triangle · Getting started





Getting Started — Drag Two Points

Two draggable points sit on the complex plane: z1z_1 (navy) and z2z_2 (orange). Grab either one and move it to see the orange distance segment, the purple midpoint, and both step-by-step panels update in real time.

Type precise values into the input fields on the right — each point has separate real and imaginary inputs accepting 5-5 to 55 in steps of 0.10.1. Five presets are available: a general pair (2+i)(-2+i) & (3+3i)(3+3i), an origin-based pair 00 & (3+4i)(3+4i), a symmetric pair, a vertical pair, and a horizontal pair. Click Random to generate two arbitrary points.

The Show circle checkbox toggles a dashed blue circle centered at z1z_1 that passes through z2z_2. Every point on this circle is the same distance from z1z_1 as z2z_2 is. Toggle it off for a cleaner view of the triangle and midpoint.

The Right Triangle and Distance Segment

When both the horizontal and vertical differences between the two points are nonzero, a right triangle appears on the plane. The green horizontal leg shows Δa=a1a2\Delta a = |a_1 - a_2| (the difference in real parts), the red vertical leg shows Δb=b1b2\Delta b = |b_1 - b_2| (the difference in imaginary parts), and the orange segment connecting z1z_1 to z2z_2 is the hypotenuse — the distance.

A small right-angle marker appears at the corner where the two legs meet. The triangle's orientation depends on the relative positions of z1z_1 and z2z_2: the corner can appear in any of four positions depending on which point is above, below, left, or right of the other.

Click the default preset (2+i)(-2+i) & (3+3i)(3+3i) to see a triangle with Δa=5\Delta a = 5 and Δb=2\Delta b = 2, giving distance 25+4=295.39\sqrt{25 + 4} = \sqrt{29} \approx 5.39. The triangle makes the Pythagorean relationship visible — the distance is always the hypotenuse.
ReIm-5−5i-4−4i-3−3i-2−2i-1−1i11i22i33i44i55iΔa = 5Δb = 2d = 5.39Mz₁z₂
(−2+i) & (3+3i), frozen

The full apparatus: legs Δa = 5 and Δb = 2, the rotated d = 5.39 riding the hypotenuse, the purple midpoint at 0.5 + 2i, and the dashed locus circle sweeping through z₂.

In the frozen frame the whole apparatus is on duty at once: both legs labeled, the right-angle marker tucked at the corner, the rotated d=5.39d = 5.39 riding the hypotenuse, the purple midpoint at 0.5+2i0.5 + 2i, and the dashed locus circle sweeping through z2z_2.

Note the two faint vectors from the origin — the tool keeps them deliberately dim, because for distance and midpoint the origin does not matter. The whole construction is translation-invariant: slide both points by the same amount and dd, the triangle, and MM's position between the points all come along unchanged. That independence from the origin is exactly what separates distance from the modulus special case.

Vertical and Horizontal Degenerate Cases

Click Vertical to load z1=1+4iz_1 = 1 + 4i and z2=12iz_2 = 1 - 2i. Both points share the same real part (a=1a = 1), so Δa=0\Delta a = 0. The right triangle collapses — the green horizontal leg vanishes and only the red vertical segment remains. The distance simplifies to b1b2=4(2)=6|b_1 - b_2| = |4 - (-2)| = 6 — see the vertical pair.

Click Horizontal to load z1=4z_1 = -4 and z2=4z_2 = 4. Both are real numbers with the same imaginary part (b=0b = 0), so Δb=0\Delta b = 0. The red vertical leg disappears and only the green horizontal segment remains. The distance is a1a2=44=8|a_1 - a_2| = |-4 - 4| = 8 — see the horizontal pair.

In both cases the right-angle marker also disappears because there is no corner — just a single straight line. These are the simplest distance illustrations: purely horizontal or purely vertical segments with the distance equal to the absolute difference along one axis.

The Vertical Pair

The Vertical preset stacks the two points on one vertical line: z1=1+4iz_1 = 1 + 4i directly above z2=12iz_2 = 1 - 2i, sharing the real part a=1a = 1.
ReIm-5−5i-4−4i-3−3i-2−2i-1−1i11i22i33i44i55id = 6Mz₁z₂
(1+4i) & (1−2i), frozen

Equal real parts silence the triangle: a single vertical drop of 6 units, with the midpoint keeping a = 1 and averaging the heights to 1 + i.

With Δa=0\Delta a = 0 the Pythagorean machinery goes quiet: no triangle, no corner marker, and the distance formula collapses to a plain subtraction of imaginary parts, 4(2)=6|4 - (-2)| = 6. One axis carries all the information.

The midpoint keeps the shared real part and averages the heights: M=1+iM = 1 + i. Any pair with equal real parts behaves this way — vertical segments are where complex distance quietly turns back into the number-line distance of the imaginary components. The mirror case is the horizontal pair; both live under the degenerate cases umbrella.

The Horizontal Pair

The Horizontal preset lays both points on the real axis: z1=4z_1 = -4 and z2=4z_2 = 4, two ordinary real numbers eight units apart.
ReIm-5−5i-4−4i-3−3i-2−2i-1−1i11i22i33i44i55id = 8Mz₁z₂
−4 & 4, frozen

Number-line distance on the complex plane: d = 8 flat along the real axis, midpoint at the origin, and the largest locus circle any preset draws.

This frame is complex distance at its most familiar: 44=8|{-4} - 4| = 8 is exactly the number-line distance between 4-4 and 44. The orange segment lies flat along the axis, and the red Δb\Delta b leg has nothing to measure.

Two bonuses hide in the frozen picture. The midpoint of 4-4 and 44 is 00, so the purple MM lands on the origin — this preset is also a symmetric pair, kin to the symmetric preset. And the dashed locus circle, centered at 4-4 with radius 88, is the largest circle any preset draws — it exits the window on three sides.

Symmetric Points and Midpoint at the Origin

Click Symmetric to load z1=32iz_1 = -3 - 2i and z2=3+2iz_2 = 3 + 2i. These points are symmetric about the origin — each is the negation of the other. The midpoint formula gives M=(z1+z2)/2=(0+0i)/2=0M = (z_1 + z_2)/2 = (0 + 0i)/2 = 0.

The purple midpoint dot sits exactly at the origin. The distance segment passes through the center of the plane, and the right triangle straddles both quadrants with legs spanning the full width and height.

This is the only preset where the midpoint coincides with the origin. It produces a distinctive SVG: the midpoint overlaps with the origin marker, and the segment is perfectly centered. The distance is 62+42=527.21\sqrt{6^2 + 4^2} = \sqrt{52} \approx 7.21.

You can create other symmetric configurations by setting z2=z1z_2 = -z_1 for any z1z_1. The midpoint will always land at the origin because the two points cancel when averaged.
ReIm-5−5i-4−4i-3−3i-2−2i-1−1i11i22i33i44i55iΔa = 6Δb = 4d = 7.21Mz₁z₂
(−3−2i) & (3+2i), frozen

Opposite points: the purple M swallows the origin dot, and the faint origin vectors lie exactly along the distance segment — additive inverses averaging to zero.

The frozen frame shows the coincidence directly: the purple MM swallows the gray origin dot, and the two faint origin vectors lie exactly along the orange distance segment — because for opposite points, the segment between them is the line through the origin.

Algebraically this preset freezes the statement z+(z)=0z + (-z) = 0: additive inverses average to zero. It is the midpoint counterpart of what the coincident state does for distance — one collapses the average, the other collapses the difference.

Distance from the Origin — Modulus as a Special Case

Click the preset 00 & (3+4i)(3+4i). When one point is the origin (z2=0z_2 = 0), the distance formula z1z2=z10=z1|z_1 - z_2| = |z_1 - 0| = |z_1| reduces to the modulus of z1z_1.

Here 3+4i=9+16=5|3 + 4i| = \sqrt{9 + 16} = 5 — the famous 3-4-5 right triangle. The green horizontal leg is 33, the red vertical leg is 44, and the orange hypotenuse is 55. The right triangle sits in Quadrant I with one vertex at the origin.

The midpoint is M=(0+3+4i)/2=1.5+2iM = (0 + 3 + 4i)/2 = 1.5 + 2i, which lies halfway along the segment from the origin to z1z_1.

This demonstrates that distance between complex numbers is a generalization of the modulus. The modulus z|z| measures distance from the origin; z1z2|z_1 - z_2| measures distance between any two points. Every modulus calculation is a distance calculation with z2=0z_2 = 0.
ReIm-5−5i-4−4i-3−3i-2−2i-1−1i11i22i33i44i55iΔa = 3Δb = 4d = 5Mz₁z₂
0 & (3+4i), frozen

z₁ pinned to the origin turns distance into modulus: the 3-4-5 triangle of |3+4i| = 5, with the locus circle becoming the textbook circle |z| = 5.

In the frozen frame, z1z_1 sits directly on the origin — its navy point covers the gray origin dot, and the faint z1z_1 vector has nothing to draw. What remains is the picture every modulus definition uses: the 3-4-5 right triangle with one vertex pinned at zero.

The dashed locus circle in this state is special too: centered on the origin with radius 5, it is precisely the set of complex numbers with modulus 5 — the circle z=5|z| = 5. Every other preset draws the general circle zz1=r|z - z_1| = r; this one draws the textbook one.

The Dashed Circle and Locus Interpretation

When the Show circle checkbox is enabled (the default), a dashed blue circle appears centered at z1z_1 with radius equal to the distance z1z2|z_1 - z_2|. The circle passes exactly through z2z_2.

This circle represents the locus of all complex numbers zz satisfying zz1=z1z2|z - z_1| = |z_1 - z_2| — every point on the circle is the same distance from z1z_1 as z2z_2 is. Dragging z2z_2 farther away makes the circle grow; dragging it closer makes the circle shrink.

Toggle the circle off to get a cleaner view focused on the triangle and midpoint alone. Toggle it back on to study the circle equation zz0=r|z - z_0| = r, which describes a circle of radius rr centered at z0z_0 in the complex plane.

Try the Horizontal preset with the circle on: the circle is centered at (4,0)(-4, 0) with radius 88, extending far across the plane. Then try the Vertical preset: the circle is centered at (1,4)(1, 4) with radius 66, sitting mostly above the real axis.

Reading the Step-by-Step Panels

The right panel contains two step-by-step breakdowns that update dynamically.

The Distance Step-by-Step panel walks through the full calculation:

First it computes z1z2z_1 - z_2 to find the difference vector. Then it applies the Pythagorean formula z1z2=Δa2+Δb2|z_1 - z_2| = \sqrt{\Delta a^2 + \Delta b^2}, substituting the actual component differences, squaring them, adding, and taking the square root. The final distance appears highlighted in orange.

The Midpoint Step-by-Step panel shows three lines: the formula M=(z1+z2)/2M = (z_1 + z_2)/2, the sum z1+z2z_1 + z_2, and the result after dividing by 22. The final midpoint appears in purple.

Both panels make the component-wise nature of these operations explicit — distance uses differences and squares, while midpoint uses sums and halving. Each updates with every drag or keystroke.

The Distance Formula for Complex Numbers

The distance between two complex numbers z1=a1+b1iz_1 = a_1 + b_1 i and z2=a2+b2iz_2 = a_2 + b_2 i is the modulus of their difference:

z1z2=(a1a2)2+(b1b2)2|z_1 - z_2| = \sqrt{(a_1 - a_2)^2 + (b_1 - b_2)^2}


This is identical to the Euclidean distance formula from coordinate geometry, treating the complex plane as the xyxy-plane with the real axis as xx and the imaginary axis as yy.

The formula comes from the Pythagorean theorem applied to the right triangle formed by the horizontal difference Δa=a1a2\Delta a = a_1 - a_2 and the vertical difference Δb=b1b2\Delta b = b_1 - b_2. The distance is the hypotenuse.

In complex notation, z1z2|z_1 - z_2| can also be written as (z1z2)(z1z2)\sqrt{(z_1 - z_2) \cdot \overline{(z_1 - z_2)}}, since for any complex number ww, w=wwˉ|w| = \sqrt{w \cdot \bar{w}}. This connects the distance formula to the conjugate and modulus properties of complex numbers.

The Midpoint Formula for Complex Numbers

The midpoint of the segment connecting z1z_1 and z2z_2 is their arithmetic average:

M=z1+z22=a1+a22+b1+b22iM = \frac{z_1 + z_2}{2} = \frac{a_1 + a_2}{2} + \frac{b_1 + b_2}{2}i


Average the real parts to get the real coordinate of the midpoint. Average the imaginary parts to get the imaginary coordinate. The result is the unique point equidistant from z1z_1 and z2z_2 along the segment connecting them.

The midpoint satisfies two key properties: Mz1=Mz2|M - z_1| = |M - z_2| (equal distance from both endpoints), and MM lies on the straight line from z1z_1 to z2z_2.

This generalizes naturally. The point that divides the segment in ratio t:(1t)t : (1-t) is z1+t(z2z1)=(1t)z1+tz2z_1 + t(z_2 - z_1) = (1-t)z_1 + tz_2. Setting t=1/2t = 1/2 gives the midpoint. Setting t=1/3t = 1/3 gives the point one-third of the way from z1z_1 to z2z_2.

Coincident Points — Distance Zero

Drag both points to the same position — for example, set both to 2+i2 + i. The distance becomes 00 because z1z2=0z_1 - z_2 = 0. The right triangle vanishes entirely (both legs have zero length), the orange distance segment shrinks to nothing, and the midpoint coincides with both points.

The dashed circle also collapses to a single point (radius 00). The step-by-step panel confirms: 02+02=0\sqrt{0^2 + 0^2} = 0.

This is the only configuration where z1z2=0|z_1 - z_2| = 0. By definition, w=0|w| = 0 if and only if w=0w = 0, so z1z2=0|z_1 - z_2| = 0 if and only if z1=z2z_1 = z_2. This property is one of the axioms of a metric — the distance between two points is zero precisely when the points coincide.
ReIm-5−5i-4−4i-3−3i-2−2i-1−1i11i22i33i44i55iMz₁z₂
z₁ = z₂ = 2 + i, frozen

Distance zero: no triangle, no circle, no d label — two stacked markers with the midpoint hiding beneath them. The only input that produces output zero.

The frozen frame is the tool with everything switched off by mathematics rather than by settings: no triangle, no circle, no distance label — just two stacked markers and the midpoint hiding beneath them at the same spot. Both step-by-step panels still run; they simply compute zeros all the way down.

Degenerate as it looks, this state carries real content: it is the definiteness half of what makes z1z2|z_1 - z_2| a genuine distance. Zero output happens for exactly one input configuration — compare the symmetric preset, where it is the midpoint, not the distance, that collapses to zero.