mirror of
https://github.com/bspeice/speice.io
synced 2025-07-29 03:25:03 -04:00
More writing for the math and browser APIs
This commit is contained in:
@ -1,5 +1,4 @@
|
||||
import {Transform} from "./transform";
|
||||
import {applyCoefs, Coefs} from "./coefs";
|
||||
import {Transform, Coefs, applyCoefs} from "./transform";
|
||||
import {blend, VariationBlend} from "./blend";
|
||||
|
||||
export const applyTransform = (coefs: Coefs, variations: VariationBlend): Transform =>
|
||||
|
@ -1,11 +0,0 @@
|
||||
export interface Coefs {
|
||||
a: number, b: number, c: number,
|
||||
d: number, e: number, f: number
|
||||
}
|
||||
|
||||
export function applyCoefs(x: number, y: number, coefs: Coefs): [number, number] {
|
||||
return [
|
||||
(x * coefs.a + y * coefs.b + coefs.c),
|
||||
(x * coefs.d + y * coefs.e + coefs.f)
|
||||
]
|
||||
}
|
@ -1 +1,13 @@
|
||||
export type Transform = (x: number, y: number) => [number, number];
|
||||
export type Transform = (x: number, y: number) => [number, number];
|
||||
|
||||
export interface Coefs {
|
||||
a: number, b: number, c: number,
|
||||
d: number, e: number, f: number
|
||||
}
|
||||
|
||||
export function applyCoefs(x: number, y: number, coefs: Coefs): [number, number] {
|
||||
return [
|
||||
(x * coefs.a + y * coefs.b + coefs.c),
|
||||
(x * coefs.d + y * coefs.e + coefs.f)
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user