Function Repository Resource:

EulerLinePoints

Source Notebook

Get the four main points of the Euler line of a triangle

Contributed by: Ed Pegg Jr

ResourceFunction["EulerLinePoints"][{p1,p2,p3}]

returns the circumcenter, centroid, nine-point center and orthocenter of the triangle defined by vertices p1,p2 and p3.

Details

The circumcenter, centroid, nine-point center and orthocenter of a triangle all lie on the Euler line.
ResourceFunction["EulerLinePoints"][Triangle[{p1,p2,p3}]] is equivalent to ResourceFunction["EulerLinePoints"][{p1,p2,p3}].

Examples

Basic Examples (1) 

Find the defining points for the Euler line of three triangle vertices:

In[1]:=
ResourceFunction["EulerLinePoints"][{{-14, -6}, {10, -6}, {4, 12}}]
Out[1]=

Scope (2) 

Compute points on the Euler line of a 3D triangle:

In[2]:=
tri = Triangle[{{0, 0, 0}, {1, 2, 0}, {0, 1, 3}}];
el = Simplify[ResourceFunction["EulerLinePoints"][tri]]
Out[2]=

Show the points and the triangle together:

In[3]:=
Legended[Graphics3D[{{Opacity[0.3, Orange], tri}, {AbsolutePointSize[8], Transpose[{{Red, Cyan, Brown, Green}, Point /@ el}]}}], PointLegend[{Red, Cyan, Brown, Green}, {"circumcenter", "centroid", "nine-point center", "orthocenter"}]]
Out[3]=

Neat Examples (1) 

A graphic of a triangle with the Euler line (blue), circumcenter|circumcircle|perpendicular bisectors (red), centroid|medians (cyan), nine-point center|circle (brown) and orthocenter|altitudes (green):

In[4]:=
tri = {{-14, -6}, {10, -6}, {4, 12}};
euler = ResourceFunction["EulerLinePoints"][tri];
mids = Mean /@ Subsets[Reverse[tri], {2}];
otherthree = Mean[{#, euler[[4]]}] & /@ tri;
Legended[Graphics[{EdgeForm[Black], White, Thick, Triangle[tri],
   Blue, InfiniteLine[Take[euler, 2]], Thin,
   Red, InfiniteLine[{euler[[1]], #}] & /@ mids, Circumsphere[tri], Disk[euler[[1]], 0.2],
   Cyan, InfiniteLine /@ Transpose[{tri, mids}], Disk[euler[[2]], 0.2],
   Brown, Circle[euler[[3]], EuclideanDistance[euler[[3]], mids[[1]]]], Disk[#, .1] & /@ otherthree, Disk[euler[[3]], 0.2],
   Green, InfiniteLine[{euler[[4]], #}] & /@ tri, Disk[euler[[4]], 0.2]}], PointLegend[{Red, Cyan, Brown, Green}, {"circumcenter", "centroid", "nine-point center", "orthocenter"}, LegendMarkers -> ConstantArray[Graphics[Disk[]], 3]]]
Out[4]=

Version History

  • 1.1.0 – 31 August 2021
  • 1.0.0 – 17 October 2019

Related Resources

License Information