MathIsimple
Geometry SpotCalculatorsLine Segments from Points

Line Segment Calculator

Calculate how many line segments can be formed by n points on a straight line using n×(n−1)÷2.

Segment Calculator
Enter the number of points to compute the total number of segments (C(n, 2)).

Minimum 2 points. Large values may produce very large outputs.

Why the formula works

A line segment is determined by choosing two distinct points. So the count is the number of ways to choose 2 points from n points:

C(n, 2) = n(n − 1)/2
  • There are n choices for the first point.
  • Then (n − 1) choices for the second point.
  • This counts each segment twice (AB and BA), so divide by 2.
Ask AI ✨