mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-11-27 18:11:20 +00:00
Add tileStartPos function and update version
Introduced tileStartPos to calculate tile coordinates based on index, size, and columns. Updated VERSIONINFO to 1.0.1 and exported the new function.
This commit is contained in:
parent
717b141cb7
commit
ab869556c4
|
|
@ -96,14 +96,25 @@ function clusteredCellsDensity(numbers, size, minDensity) {
|
|||
return density >= minDensity;
|
||||
}
|
||||
|
||||
function tileStartPos(index, size, cols) {
|
||||
if (typeof size !== 'number') size = 130;
|
||||
if (typeof cols !== 'number') cols = 4;
|
||||
|
||||
var i = index - 1; // convert 1-based -> 0-based
|
||||
var col = i % cols;
|
||||
var row = Math.floor(i / cols);
|
||||
return { x: col * size, y: row * size };
|
||||
}
|
||||
|
||||
exports.DTM = DTM;
|
||||
exports.arrayCos = arrayCos;
|
||||
exports.measureSimilarity = measureSimilarity;
|
||||
exports.export_measureSimilarity = export_measureSimilarity;
|
||||
exports.cartesianProduct = cartesianProduct;
|
||||
exports.clusteredCellsDensity = clusteredCellsDensity;
|
||||
exports.tileStartPos = tileStartPos;
|
||||
|
||||
exports.VERSIONINFO = "ExtraMath module (extramath.js) version 1.0.0";
|
||||
exports.VERSIONINFO = "ExtraMath module (extramath.js) version 1.0.1";
|
||||
exports.AUTHOR = "gnh1201@catswords.re.kr";
|
||||
exports.global = global;
|
||||
exports.require = global.require;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user