JavaScript
/* (c) Michiel van der Blonk
* a model of basic phycics quantities
* July 2012
* some code adapted from http://bl.ocks.org/1153292
*/
var width = 960,
height = 700,
r = 12,
gravity = 0.1,
distance = 100,
charge = -800,
fill = d3.scale.category10(),
// these are the quantities
// the groups are
// 1: essential axiomatic units m, l, t
// 2: related to movement
// 3: related to energy
// 4: related to a single unit
nodes=[
{name:"Mass", symbol:"m", unit:"kg", group:1},
{name:"Time", symbol:"t", unit:"s", group:1},
{name:"Length", symbol:"d", unit:"m", group:1},
{name:"Force", symbol:"F", unit:"N", group:3, formula:"F=m.a"},
{name:"Velocity", symbol:"v", unit:"m/s", group:2, formula:"v=d/t"},
{name:"Acceleration", symbol:"a", unit:"m/(s.s)", group:2, formula:"a=v/d"},
{name:"Work", symbol:"W", unit:"J", group:3, formula:"W=F.d"},
{name:"Momentum", symbol:"p", unit:"kg.m/s", group:2, formula:"p=m.v"},
{name:"Impulse", symbol:"I", unit:"N.s", group:2, formula:"I=F.t"},
{name:"Energy (k)", symbol:"E", unit:"J", group:3, formula:"Ek=0.5m.v.v"},
{name:"Power", symbol:"P", unit:"W", group:3, formula:"P=W/t"},
{name:"Pressure", symbol:"p", unit:"Pa", group:3, formula:"p=F/A"},
{name:"Area", symbol:"A", unit:"m.m", group:4, formula:"A=d*d"},
{name:"Volume", symbol:"V", unit:"m.m.m", group: "4", formula:"V=A*d"},
{name:"Frequency", symbol:"f", unit:"Hz", group:4, formula:"f=1/t"}
],
// the relations shown can be calculated using
// formulas from either 1 or 2 other quantities
links=[
{"source":1,"target":4,"value":1}, {"source":2,"target":4,"value":1}, // velocity
{"source":2,"target":5,"value":1}, {"source":4,"target":5,"value":1}, // acceleration
{"source":0,"target":3,"value":1}, {"source":5,"target":3,"value":1}, // force
...