Published
Edited
Jul 23, 2020
1 fork
2 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
Algebra(2,0,1, ()=>{

var point = (x,y)=>1e12+x*1e02+y*1e01,
myprint = (lab,num)=>lab+num.toFixed(3),
ps = (mv) => mv.e012,
first = true;
// Three points.
var A=point(-.5,0),
B=point(.5,.2),
X=(A+B).Normalized,
m=()=>(A&B).Normalized,
n=m<<(A+B), // line perp to m thru X
n = ()=>m<<X;
var negColor = 0x000000,
posColor = 0xcccccc;
return this.graph(()=>{
var apx = (A&n).s, bpx = (B&n).s;
X = m^n; // force X to lie on line m
return ["Point in segment via wedge",myprint("A v n=",apx)+" "+myprint("B v n=",bpx),
0x444444,A,"A",B,"B",
0xff0000,m,"m",
0x0000ff,n,"n",
0x00cc00,[A,B],
(apx*bpx <= 0 ? 0x00cc00 : 0xff0000),X,"X"]
}, {
// more render properties for the default items.
pointRadius:1.5, // point radius
lineWidth:2, // line width
fontSize:1.5, // font size
grid:false, // grid
scale:2,
width:window.innerWidth});
})
Insert cell
Insert cell
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