(other)
| 895 | return new Matrix2(matrix2add(this.ptr, other.ptr)); |
| 896 | } |
| 897 | sub(other) { |
| 898 | if (typeof other === "number") { |
| 899 | return new Matrix2(this.x.sub(other), this.y.sub(other)); |
| 900 | } |
| 901 | return new Matrix2(matrix2sub(this.ptr, other.ptr)); |
| 902 | } |
| 903 | mul(other) { |
| 904 | if (typeof other === "number") { |
| 905 | return new Matrix2(this.x.mul(other), this.y.mul(other)); |