Skip to content

Instantly share code, notes, and snippets.

@mathdoodle
mathdoodle / Example.spec.ts
Last active October 28, 2016 01:25
Bacon.js Registration Tutorial
export default function() {
describe("...", function() {
it("should ...", function() {
expect(true).toBeTruthy()
})
})
}
@mathdoodle
mathdoodle / README.md
Last active February 19, 2018 01:46
EIGHT Parallelepiped

Parallelepiped

export default function() {
describe("...", function() {
it("should ...", function() {
expect(true).toBeTruthy()
})
})
}
@mathdoodle
mathdoodle / G11.ts
Last active October 15, 2017 17:56
Geometric Computer Algebra
const G = GeoCAS.algebra([+1, -1], new GeoCAS.ComplexFieldAdapter(), ['e_1','e_2'])
export const zero = G.zero;
export const one = G.one;
export const e1 = G.unit(0);
export const e2 = G.unit(1);
@mathdoodle
mathdoodle / README.md
Last active September 23, 2016 19:54
orthoFramesToVersor algorithm

orthoFramesToVersor algorithm

Overview

Experiment in implementing this algorithm in TypeScript over the GeoCAS.Multivector type.

@mathdoodle
mathdoodle / README.md
Last active July 22, 2020 22:25
Homogeneous 3D Geometric Algebra

Homogeneous 3D Geometric Algebra

Overview

This program demonstrates how to compute using the elements of the Homogeneous Model using Geometric Algebra.

In this example, the elements that we work with are points and lines. A finite point is represented by

$$ X = \alpha (e_0 + \bar{x})

@mathdoodle
mathdoodle / README.md
Last active September 20, 2016 14:36
EIGHT with GeoCAS Multivector

EIGHT with GeoCAS

Overview

Researching the operation of GeoCAS.Multivector.

@mathdoodle
mathdoodle / Algebra.ts
Last active September 20, 2016 04:04
GeoCAS Multivector
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]);
}
@mathdoodle
mathdoodle / Overlay.ts
Last active July 7, 2020 19:16
Diagram3D
import { PerspectiveCamera, VectorE3, VectorE2, Geometric3 } from 'davinci-eight'
export default class Overlay {
public ctx: CanvasRenderingContext2D;
constructor(_canvas: string, private camera: PerspectiveCamera) {
const canvasElement = <HTMLCanvasElement> document.getElementById('canvas2D');
this.ctx = canvasElement.getContext('2d') as CanvasRenderingContext2D;
this.ctx.strokeStyle = "#FFFFFF";
this.ctx.fillStyle = '#ffffff';
this.ctx.font = '24px Helvetica';
@mathdoodle
mathdoodle / HTMLOverlay.ts
Last active July 21, 2020 20:39
Overlay for WebGL
export interface Cartesian3 {
x: number
y: number
z: number
}
export interface Camera {
eye: Cartesian3
look: Cartesian3