Skip to content

Commit

Permalink
Merge 2f4299d into a927e17
Browse files Browse the repository at this point in the history
  • Loading branch information
ngfelixl committed Feb 4, 2019
2 parents a927e17 + 2f4299d commit 5b7a164
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/matrix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,11 @@ export class Matrix extends Array<Vector> {
}

/**
*
* Multiplicates the matrix with a given input. If the input is
* a matrix, it will perform a matrix-matrix multiplication. If
* it is a vector, it determines the matrix-vector product, and
* if it is a scalar value, each element will be multiplied by
* it.
* @param multiplicator
*/
dot<T extends Vector | Matrix | number>(multiplicator: T): T extends Vector ? Vector : Matrix;
Expand Down
1 change: 1 addition & 0 deletions src/vector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ export class Vector extends Array<number> {
* it will perform a vector-scalar-multiplication.
* @param vector
*/
dot<T extends Vector | number[] | number>(vector: T): T extends Vector ? number : Vector;
dot(vector: Vector | number[] | number): Vector | number {
if (vector instanceof Vector || vector instanceof Array) {
if (vector.length === 1) {
Expand Down

0 comments on commit 5b7a164

Please sign in to comment.