From b2a466ce8b851223fa1a6362c7c6825e59a8449a Mon Sep 17 00:00:00 2001 From: John Alanbrook Date: Fri, 7 Jun 2024 00:39:37 -0500 Subject: [PATCH] add box point generation --- scripts/geometry.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/geometry.js b/scripts/geometry.js index cee029d..080e6e3 100644 --- a/scripts/geometry.js +++ b/scripts/geometry.js @@ -1,4 +1,9 @@ var shape = {}; +shape.box = {}; +shape.box.points = function(ll, ur) +{ + return [ll, ll.add([ur.x-ll.x,0]), ur, ll.add([0,ur.y-ll.y])]; +} shape.sphere = {}; shape.circle = {}; shape.sphere.volume = function(r) { return Math.pi*r*r*r*4/3; };