From 7a2ef828597f83abb7540eece8ebc18f6459b296 Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Sat, 15 Jun 2019 16:55:20 +0100 Subject: [PATCH] feat(matrices): add matXXn & matXXv fns --- packages/matrices/src/index.ts | 2 ++ packages/matrices/src/matn.ts | 15 +++++++++++++++ packages/matrices/src/matv.ts | 14 ++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 packages/matrices/src/matn.ts create mode 100644 packages/matrices/src/matv.ts diff --git a/packages/matrices/src/index.ts b/packages/matrices/src/index.ts index 3d82cded12..9f9574c48c 100644 --- a/packages/matrices/src/index.ts +++ b/packages/matrices/src/index.ts @@ -20,6 +20,8 @@ export * from "./m23-m22"; export * from "./m23-m44"; export * from "./m33-m44"; export * from "./m44-m33"; +export * from "./matn"; +export * from "./matv"; export * from "./mixq"; export * from "./mul"; export * from "./mulm"; diff --git a/packages/matrices/src/matn.ts b/packages/matrices/src/matn.ts new file mode 100644 index 0000000000..92387c04a8 --- /dev/null +++ b/packages/matrices/src/matn.ts @@ -0,0 +1,15 @@ +import { Mat } from "./api"; +import { + scale22, + scale23, + scale33, + scale44 +} from "./scale"; + +export const mat2n = (out: Mat | null, n: number) => scale22(out, n); + +export const mat23n = (out: Mat | null, n: number) => scale23(out, n); + +export const mat3n = (out: Mat | null, n: number) => scale33(out, n); + +export const mat4n = (out: Mat | null, n: number) => scale44(out, n); diff --git a/packages/matrices/src/matv.ts b/packages/matrices/src/matv.ts new file mode 100644 index 0000000000..23ffa6a1ea --- /dev/null +++ b/packages/matrices/src/matv.ts @@ -0,0 +1,14 @@ +import { + setVV16, + setVV4, + setVV6, + setVV9 +} from "@thi.ng/vectors"; + +export const mat2v = setVV4; + +export const mat23v = setVV6; + +export const mat33v = setVV9; + +export const mat44v = setVV16;