Engine prototype #13

Merged
glen merged 133 commits from engine-proto into main 2024-10-21 03:18:48 +00:00
2 changed files with 18 additions and 22 deletions
Showing only changes of commit 3b10c95d5f - Show all commits

View File

@ -19,14 +19,14 @@
<body> <body>
<script> <script>
// in the default view, e4 + e5 is the point at infinity // in the default view, e4 + e5 is the point at infinity
CGA3 = Algebra(4, 1); let CGA3 = Algebra(4, 1);
v1 = CGA3.inline(() => 1e1 + 1e5)(); let v1 = CGA3.inline(() => 1e1 + 1e5)();
v2 = CGA3.inline(() => 1e2 + 1e5)(); let v2 = CGA3.inline(() => 1e2 + 1e5)();
v3 = CGA3.inline(() => 1e3 + 1e5)(); let v3 = CGA3.inline(() => 1e3 + 1e5)();
w1 = CGA3.inline(() => 1e1 - Math.sqrt(0.2)*1e4 + Math.sqrt(1.2)*1e5)(); let w1 = CGA3.inline(() => 1e1 - Math.sqrt(0.2)*1e4 + Math.sqrt(1.2)*1e5)();
w2 = CGA3.inline(() => 1e2 - Math.sqrt(0.2)*1e4 + Math.sqrt(1.2)*1e5)(); let w2 = CGA3.inline(() => 1e2 - Math.sqrt(0.2)*1e4 + Math.sqrt(1.2)*1e5)();
w3 = CGA3.inline(() => 1e3 - Math.sqrt(0.2)*1e4 + Math.sqrt(1.2)*1e5)(); let w3 = CGA3.inline(() => 1e3 - Math.sqrt(0.2)*1e4 + Math.sqrt(1.2)*1e5)();
s = CGA3.inline(() => -Math.sqrt(1.2)*1e4 + Math.sqrt(0.2)*1e5); let s = CGA3.inline(() => -Math.sqrt(1.2)*1e4 + Math.sqrt(0.2)*1e5);
document.body.appendChild(CGA3.graph( document.body.appendChild(CGA3.graph(
[ [

View File

@ -25,20 +25,16 @@ canvas {
} }
""" """
# the "points spheres plane" example from the Ganja coffee shop graph_script = """
#
# https://enkimute.github.io/ganja.js/examples/coffeeshop.html#cga3d_points_spheres_planes
#
sphere_example = """
// in the default view, e4 + e5 is the point at infinity // in the default view, e4 + e5 is the point at infinity
CGA3 = Algebra(4, 1); let CGA3 = Algebra(4, 1);
v1 = CGA3.inline(() => 1e1 + 1e5)(); let v1 = CGA3.inline(() => 1e1 + 1e5)();
v2 = CGA3.inline(() => 1e2 + 1e5)(); let v2 = CGA3.inline(() => 1e2 + 1e5)();
v3 = CGA3.inline(() => 1e3 + 1e5)(); let v3 = CGA3.inline(() => 1e3 + 1e5)();
w1 = CGA3.inline(() => 1e1 - Math.sqrt(0.2)*1e4 + Math.sqrt(1.2)*1e5)(); let w1 = CGA3.inline(() => 1e1 - Math.sqrt(0.2)*1e4 + Math.sqrt(1.2)*1e5)();
w2 = CGA3.inline(() => 1e2 - Math.sqrt(0.2)*1e4 + Math.sqrt(1.2)*1e5)(); let w2 = CGA3.inline(() => 1e2 - Math.sqrt(0.2)*1e4 + Math.sqrt(1.2)*1e5)();
w3 = CGA3.inline(() => 1e3 - Math.sqrt(0.2)*1e4 + Math.sqrt(1.2)*1e5)(); let w3 = CGA3.inline(() => 1e3 - Math.sqrt(0.2)*1e4 + Math.sqrt(1.2)*1e5)();
s = CGA3.inline(() => -Math.sqrt(1.2)*1e4 + Math.sqrt(0.2)*1e5); let s = CGA3.inline(() => -Math.sqrt(1.2)*1e4 + Math.sqrt(0.2)*1e5);
document.body.appendChild(CGA3.graph( document.body.appendChild(CGA3.graph(
[ [
@ -70,4 +66,4 @@ loadjs!(win, "https://unpkg.com/ganja.js")
# launch Ganja visualization # launch Ganja visualization
body!(win, "", async=false) body!(win, "", async=false)
js(win, JSString(sphere_example)) js(win, JSString(graph_script))