Published
Edited
Jul 20, 2020
1 fork
2 stars
Insert cell
Insert cell
texmd`Here we discuss how to represent the classical triangle centers within 2D EPGA.

Let $A$, $B$, and $C$ be the normalized vertices of the triangle. Then define the three sides: $$a:=B\vee C,~~~b:=C\vee A,~~~c:=A\vee B$$ Note that these sides are **not** normalized.

The centroid is the intersection of the medians. These are the join of the vertex with the midpoint of the opposite side:
$$m_a:=a \vee (B+C),~~~m_b:=b \vee (C+A),~~~m_c:=c \vee (A+B)$$
**Exercise:** The centroid is $M_c := m_a\wedge m_b \cong A+B+C$.

The orthocenter is simple to obtain since the altitudes of the triangle can be simply obtained via the inner product of a vertex with its opposite side:
$$h_a:=a\cdot A,~~~h_b:=b \cdot B,~~~h_c:=c \cdot C$$
The orthocenter is then $O_c := h_a \vee h_b$.

The circumcenter arises in a similar way. Instead of using the perpendicular to the side through the opposite vertex, we use the perpendicular to the side through the midpoint of the side:
$$p_a:=a\cdot (B+C),~~~p_b:=b \cdot (C+A),~~~p_c:=c \cdot (A+B)$$
The circumcenter is then $C_c := p_a \vee p_b$.

The demo below shows these three centers, along with their common line, the *Euler line* of the triangle. It's well-known that $M_c$ lies between $C_c$ and $O_c$, and that $O_c$ lies twice as far from $M_c$ as does $C_c$.

There
`
Insert cell
Algebra({
metric:[0,1,1],
basis:['1','e0','e1','e2','e01','e02','e12','e012']
}, ()=>{

// The Euler line connects several important points in any non equilateral triangle.

// Not many identities needed..
var point = (x,y)=>1e12+x*1e02+y*1e01,
{sin, cos, PI} = Math;
// Three points.
var A=point(-.3,0.5).Normalized, B=point(0.5,.5).Normalized, C=point(0,0).Normalized,

// The edges
a=()=>B&C,b=()=>C&A,c=()=>A&B,

// The centroid
centroid = ()=>(A+B+C).Normalized,
// The orthocenter
oa=()=>(a<<A).Normalized, ob=()=>(b<<B).Normalized, oc=()=>(c<<C).Normalized, ortho=()=>oa^ob,
// The circumcenter
ca=()=>(c<<(A+B)).Normalized, cb=()=>(a<<(B+C)).Normalized, cc=()=>(b<<(C+A)).Normalized, circum=()=>ca^cb,
// The Euler line
euler = ()=>(ortho&circum).Normalized,
orthoL = ()=>polarLine(ortho).Normalized,
// symmetric product: appears equal to polar line of orthocenter
// which is furthermore perpendicular to the euler line
s = ()=>a*b*c+b*c*a+c*a*b+a*c*b+b*a*c+c*b*a;
function polarLine(X){
  var ax = ()=> X&A, bx =()=> X&B, cx =()=> X&C; // joining lines to three corners
var AX = ()=> ax^a, BX =()=> bx^b, CX = ()=> cx^c; // intersection points with three sides
var am = ()=> BX&CX, bm =()=> CX&AX, cm =()=> AX&BX;
var AM = ()=> am^a, BM = ()=> bm^b, CM = ()=> cm^c;
return ()=>AM&BM;
};
// The hyperbolic disk
var disc = [...Array(100)]
.map((x,i)=>point(sin(i/50*PI),cos(i/50*PI)))
.map((x,i,a)=>[x,a[i+1]||a[0]]);

return this.graph(()=>{
var odote = euler<<orthoL;
return ["Triangle centers","o.e="+odote.s.toFixed(4),
0xFFFFEE,[A,B,C], // triangle
0xaaaaaa,a,"a",b,"b",c,"c",
0xAA8888,oa,ob,oc,ortho,"O", polarLine(ortho), "o", // orthocenter
0x448844,ca,cb,cc,circum,"C",0x00ff00,polarLine(circum),"c", // circumcenter
0x8888AA,centroid,"M",polarLine(centroid),"m",euler,"Euler Line", // centroid and euler line
0x444444,A,"A",B,"B",C,"C", // triangle vertices
0x000000,...(1e0*1e0==-1?disc:[]),
0xff0000,()=>orthoL^euler,"X",s,"s"]
}, {
// more render properties for the default items.
pointRadius:1.5, // point radius
lineWidth:2, // line width
fontSize:1.5, // font size
grid:true, // grid
scale:2,
width:window.innerWidth,
animate:true});
})
Insert cell
Algebra = require('ganja.js')
Insert cell
import {texmd} from '@kelleyvanevert/katex-within-markdown'
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more