MCPcopy Create free account
hub / github.com/Code-Bullet/Jump-King / transformPoints

Function transformPoints

libraries/p5.js:4505–4519  ·  view source on GitHub ↗
(points, transform)

Source from the content-addressed store, hash-verified

4503
4504// Transform an array of points and return a new array.
4505function transformPoints(points, transform) {
4506 var newPoints = [];
4507 for (var i = 0; i < points.length; i += 1) {
4508 var pt = points[i];
4509 var newPt = {
4510 x: transform.xScale * pt.x + transform.scale01 * pt.y + transform.dx,
4511 y: transform.scale10 * pt.x + transform.yScale * pt.y + transform.dy,
4512 onCurve: pt.onCurve,
4513 lastPointOfContour: pt.lastPointOfContour
4514 };
4515 newPoints.push(newPt);
4516 }
4517
4518 return newPoints;
4519}
4520
4521function getContours(points) {
4522 var contours = [];

Callers 1

buildPathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected