* @param {p5.Vector} v vector to multiply with the components of the original vector. * @chainable
(args)
| 979 | * @chainable |
| 980 | */ |
| 981 | mult(args) { |
| 982 | const minDimension = prioritizeSmallerDimension(this.dimensions, args); |
| 983 | shrinkToDimension(this.values, minDimension); |
| 984 | |
| 985 | if(Array.isArray(args)){ |
| 986 | for (let i = 0; i < this.values.length; i++) { |
| 987 | this.values[i] *= args[i]; |
| 988 | } |
| 989 | } else { |
| 990 | for (let i = 0; i < this.values.length; i++) { |
| 991 | this.values[i] *= args; |
| 992 | } |
| 993 | } |
| 994 | |
| 995 | return this; |
| 996 | } |
| 997 | |
| 998 | /** |
| 999 | * Divides a vector's components. |
no test coverage detected