geomagnetic-coords
Advanced tools
Comparing version 0.0.1 to 0.0.2
{ | ||
"name": "geomagnetic-coords", | ||
"description": "Dependency-free geomagnetic<-->geographic coordinate transformer ", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"author": "Joseph Beuckman <joebeuckman@gmail.com> (jbeuckm.github.io)", | ||
@@ -11,5 +11,7 @@ "repository": { | ||
"type": "module", | ||
"main": "index.ts", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"scripts": { | ||
"test": "jest" | ||
"test": "jest", | ||
"prepublish": "tsc" | ||
}, | ||
@@ -19,4 +21,5 @@ "devDependencies": { | ||
"@babel/preset-typescript": "^7.23.3", | ||
"jest": "^29.7.0" | ||
"jest": "^29.7.0", | ||
"typescript": "^5.3.3" | ||
} | ||
} |
@@ -1,9 +0,9 @@ | ||
export function multiplyVectorByMatrix(vector, matrix) { | ||
export function multiplyVectorByMatrix(vector: number[], matrix: number[][]) { | ||
// Check if the vector and matrix are compatible for multiplication | ||
if (vector.length !== matrix[0].length) { | ||
throw new Error('Incompatible dimensions for multiplication') | ||
throw new Error("Incompatible dimensions for multiplication"); | ||
} | ||
// Initialize the result vector with zeros | ||
let result = Array(matrix.length).fill(0) | ||
let result = Array(matrix.length).fill(0); | ||
@@ -13,7 +13,7 @@ // Perform the multiplication | ||
for (let j = 0; j < vector.length; j++) { | ||
result[i] += matrix[i][j] * vector[j] | ||
result[i] += matrix[i][j] * vector[j]; | ||
} | ||
} | ||
return result | ||
return result; | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39100
22
705
4