* @param {p5.Vector | Number[]} value divisor vector. * @chainable
(args)
| 649 | * @chainable |
| 650 | */ |
| 651 | rem(args) { |
| 652 | const minDimension = prioritizeSmallerDimension(this.dimensions, args); |
| 653 | |
| 654 | shrinkToDimension(this.values, minDimension); |
| 655 | |
| 656 | if(Array.isArray(args)){ |
| 657 | for (let i = 0; i < this.values.length; i++) { |
| 658 | if (args[i] > 0) { |
| 659 | this.values[i] = this.values[i] % args[i]; |
| 660 | } |
| 661 | } |
| 662 | } else if(args > 0) { |
| 663 | for (let i = 0; i < this.values.length; i++) { |
| 664 | this.values[i] = this.values[i] % args; |
| 665 | } |
| 666 | } |
| 667 | |
| 668 | return this; |
| 669 | } |
| 670 | |
| 671 | /** |
| 672 | * Subtracts from a vector's components. |
no test coverage detected