Skip to content

Instantly share code, notes, and snippets.

@mvbattan
Created April 7, 2017 14:56
Show Gist options
  • Select an option

  • Save mvbattan/b5658f1acd3a625d5b088141d8c4800d to your computer and use it in GitHub Desktop.

Select an option

Save mvbattan/b5658f1acd3a625d5b088141d8c4800d to your computer and use it in GitHub Desktop.
Scaler.js
import { Point } from './pointUtils';
export const startingPoint = Point(-20 , 8);
const endingPoint = Point(242, 100);
export function vectorTransform(point, maxValue, scaleCount) {
return Point(
point.x * (endingPoint.x / scaleCount) + endingPoint.x / scaleCount,
point.y * (endingPoint.y / maxValue)
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment