more diagonal work (unfinished)

This commit is contained in:
Tim
2024-05-04 21:05:12 -04:00
parent 171d6431ae
commit 95fd55e560
8 changed files with 92 additions and 51 deletions

View File

@@ -28,6 +28,19 @@ export function vectorIsZero(value) {
}
export function vectorEquals(a, b) {
if (a === b) return true
if (a === null && b !== null || a !== null && b === null) return false
// noinspection JSObjectNullOrUndefined
if (a.length !== b.length )
return false
for (let i = 0; i < a.length; i++)
if (a[i] !== b[i])
return false
return true
}
export function vectorAdd(a, b) {
const result = []
const scalarB = b.length === undefined