Skip to content
Discussion options

You must be logged in to vote

do you need something like this?

default: {
const n = scaledCoords.length / 2;
const { y: scaleY, x: scaleX } = scaledCoords.reduce(
({ y, x }, val, idx) => (!(idx % 2) ? { y, x: x + val / n } : { y: y + val / n, x }),
{ y: 0, x: 0 }
);
return [scaleX, scaleY];

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@gpanciera
Comment options

Answer selected by gpanciera
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants