Skip to content

Instantly share code, notes, and snippets.

View stemcstudio's full-sized avatar

David George Holmes stemcstudio

View GitHub Profile
@stemcstudio
stemcstudio / Complex.spec.ts
Last active May 24, 2024 15:52
Operator Overloading
import { Complex } from './Complex'
export function complexSpec() {
describe("constructor", function() {
const x = Math.random()
const y = Math.random()
const z = new Complex(x, y)
it("should preserve real argument", function() {
expect(z.real).toBe(x)
})
@stemcstudio
stemcstudio / Algebra.ts
Last active August 4, 2020 17:49
GeoCAS
function wedge(a: number[], b: number[]): number[] {
const result: number[] = [];
const aLen = a.length;
const bLen = b.length;
for (let i = 0; i < aLen; i++) {
result.push(a[i]);
}
for (let i = 0; i < bLen; i++) {
result.push(b[i]);
}
@stemcstudio
stemcstudio / README.md
Last active May 24, 2024 16:12
Eight Template

davinci-eight (WebGL) Graphics

@stemcstudio
stemcstudio / README.md
Last active August 8, 2016 14:53
Vector Modeling Problem Framework

Vector Modeling Problem Framework

Overview

This is a starter project for creating Computational Projects for learning geometry, kinematics and dynamics.

A student develops their own Vector3 class for describing the position and velocity of objects in 3D. This class then becomes the basis for future projects. Vector3 is a springboard to Geometric3, a geometric object for Euclidean space using Geometric Algebra.

The Vector3 class in the file Vector3.ts is initially nothing more than a triple of Cartesian coordinates. The goal is to develop the Vector3 class into a mathematical object supporting coordinate-free geometry. The student develops an appreciation of the power of geometric objects for representing physical laws.

@stemcstudio
stemcstudio / README.md
Last active August 3, 2016 21:00
Geometric3 in Computational Modeling

Vector Modeling Problem Framework

Overview

This is a starter project for creating Computational Projects for learning geometry, kinematics and dynamics.

A student develops their own Vector3 class for describing the position and velocity of objects in 3D. This class then becomes the basis for future projects. Vector3 is a springboard to Geometric3, a geometric object for Euclidean space using Geometric Algebra.

The Vector3 class in the file Vector3.ts is initially nothing more than a triple of Cartesian coordinates. The goal is to develop the Vector3 class into a mathematical object supporting coordinate-free geometry. The student develops an appreciation of the power of geometric objects for representing physical laws.

@stemcstudio
stemcstudio / Bug.ts
Last active August 10, 2016 11:31
Bug Geometry on a Sphere
/**
* Scratch variable for implementing the rotate method.
*/
const R = EIGHT.Geometric3.zero();
/**
* Heading
*/
const INDEX_H = 0;
/**
* Left
@stemcstudio
stemcstudio / README.md
Last active August 4, 2020 15:09
DaVinci eight Grids

Grids

Overview

Demonstrates how to write convenience wrappers for the EIGHT.Grid.

gridXY demonstrates a complete encapsulation.

gridYZ demonstrates a customized options list.

@stemcstudio
stemcstudio / README.md
Last active January 6, 2024 15:35
DaVinci eight Sphere

DaVinci eight Sphere

@stemcstudio
stemcstudio / README.md
Last active January 6, 2024 15:38
DaVinci eight Box

Creating a Box

@stemcstudio
stemcstudio / README.md
Last active August 4, 2020 18:28
Vector Addition

Vector Addition