From 45a2cfca666e5698462090399ff2db13be57a38c Mon Sep 17 00:00:00 2001 From: Brian Cully Date: Tue, 16 Dec 2025 17:54:47 -0500 Subject: rename velocity to speed mass is a scalar quantity --- site/main.mjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'site/main.mjs') diff --git a/site/main.mjs b/site/main.mjs index 6bd2093..e049dea 100644 --- a/site/main.mjs +++ b/site/main.mjs @@ -61,7 +61,7 @@ function renderVars(vm) { e.removeChild(e.lastChild); } - ['out', 'heading', 'velocity', 'doppler'].forEach(name => { + ['out', 'heading', 'speed', 'doppler'].forEach(name => { const dt = document.createElement('dt'); dt.textContent = name; e.appendChild(dt); @@ -90,11 +90,11 @@ function renderArena(robos) { robos.forEach(robo => { let heading = robo.vm.heading(); - let velocity = robo.vm.velocity(); + let speed = robo.vm.speed(); let [velx, vely] = [ Math.cos(2 * Math.PI * heading / 360), Math.sin(2 * Math.PI * heading / 360) - ].map(x => velocity * x); + ].map(x => speed * x); renderRobo(ctx, robo.x, robo.y); robo.x += velx; -- cgit v1.3