All files / src/geometry Shape.ts

100% Statements 8/8
100% Branches 2/2
100% Functions 2/2
100% Lines 8/8

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 111x 30x     30x 634x 634x 634x 634x 30x  
export abstract class Shape {
	static tolerance = 2;
	public abstract transform(matrix: Array<number>): this;
 
	static applyTransform(p: Array<number>, m: Array<number>): Array<number> {
		const xt = p[0] * m[0] + p[1] * m[2] + m[4];
		const yt = p[0] * m[1] + p[1] * m[3] + m[5];
		return [xt, yt];
	}
}