Skip to content
Omnikalc

Viviani’s theorem calculator

Enter the three sides of a triangle and the distances from an interior point to two of them to get the third distance, the barycentric coordinates of the point, the altitudes and the constant sum for an equilateral triangle.

Updated on
Your inputs
cm

Value out of range

cm

Value out of range

cm

Value out of range

cm

Value out of range

cm

Value out of range

Results

Distance to side c

1.741 cm

Barycentric weight at vertex A

26.09 %

Sum of the three distances
6.741 cm
Area of the triangle
26.833 cm²
Barycentric weight at vertex B
44.72 %
Barycentric weight at vertex C
29.19 %
Altitude onto side a
7.667 cm
Constant sum if the triangle were equilateral with side a
6.062 cm

The Viviani’s theorem calculator gives the third distance from an interior point to the sides of a triangle when two are known, the sum of the distances, the barycentric weights of the point and the altitude, using the relation a·d_a + b·d_b + c·d_c = 2Δ.

How the calculation works

  • Enter the three sides a, b and c of the triangle.
  • Enter the distances from the point to sides a and b.
  • Read the third distance and the barycentric weights of the point.

Example

In a triangle with sides 7 cm, 8 cm and 9 cm and an area of 26.833 cm², a point at 2 cm from side a and 3 cm from side b is 1.741 cm from side c, so the three distances add up to 6.741 cm. Its barycentric weights are 26.09 %, 44.72 % and 29.19 %. An equilateral triangle of side a would have a constant sum of 6.062 cm.

Why it matters

The calculator helps students and teachers of geometry, surveyors, engineers and game developers who place a point in a triangle, interpolate values with barycentric coordinates, share a plot of land, or check Viviani’s theorem on an example, and need the missing distance without drawing the figure.

Good to know

The relation holds for any triangle, and the sum of the three distances is constant only when the triangle is equilateral. A negative third distance means the point is outside the triangle, so lower one of the two distances. The sides must satisfy the triangle inequality. The distances are measured perpendicular to the sides. All values use one length unit, and the area uses its square. The barycentric weights are in percent and add up to 100 percent.

The triangle calculator solves the basic measures, the triangle centers calculator locates special points, the triangle solver finds sides and angles, and the Euler line calculator gives distances between the main centers.

Frequently asked questions

What does Viviani’s theorem say?

In an equilateral triangle, the sum of the distances from any interior point to the three sides is constant and equal to the altitude of the triangle. Vincenzo Viviani, a pupil of Galileo, proved it in the 17th century. For a side of 10, the altitude is 8.66, so the three distances from any point always add up to 8.66.

Does it work for any triangle?

For a general triangle the sum of the distances is not constant, but a weighted sum is: a × d_a + b × d_b + c × d_c = 2Δ, where Δ is the area. It comes from cutting the triangle into three smaller triangles that share the point. The calculator uses this to find the third distance from the other two.

What are the barycentric coordinates?

The share of the area taken by each small triangle, for example a × d_a / (2Δ), is the barycentric weight of the point at the opposite vertex. The three weights add up to 100 %. A point at the centroid has three weights of 33.3 %, and a point at a vertex has 100 % on that vertex and 0 % on the others.

What if the third distance is negative?

A negative distance means the point is outside the triangle, on the other side of side c. The same relation holds with a signed distance. In practice this means the two distances entered are too large for an interior point, so reduce one of them to place the point inside.

Was this calculator helpful?

Thanks for your feedback!

Results are estimates provided for information purposes. They do not replace professional advice.