Published
Edited
Oct 5, 2020
22 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Algebra = require('ganja.js')
Insert cell
Algebra(2,1,()=>(1+3e2-2e12)*(2e3))
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Algebra(0).graph(x=>Math.sin(x*5))
Insert cell
Insert cell
Insert cell
Algebra(2,0,1,()=>{
var point = (x,y)=>1e12-x*1e02+y*1e01;
var A=point(-1.5,0.5), B=point(0.5,-0.2), C=point(1,0.5),
a=()=>B&C,b=()=>C&A,c=()=>A&B,
oa=()=>a<<A, ob=()=>b<<B, oc=()=>c<<C, ortho=()=>oa^ob, //orthocenter
ca=()=>c<<(A+B), cb=()=>a<<(B+C), cc=()=>b<<(C+A), circum=()=>ca^cb, //circumcenter
centroid = ()=>A+B+C,
Euler = ()=>ortho&circum;
return this.graph([
0xFFFFEE,[A,B,C], // the triangle
0xFFAAAA,oa,ob,oc,ortho,
0x88AA88,ca,cb,cc,circum,
0x8888FF,centroid,
Euler,"Euler Line",
0x444444,A, 'A', B, 'B', C, 'C'
],{gl:false, grid:false});
})
Insert cell
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