Is there a word for rotating and scaling an object at the same time?

56 Views Asked by At

I consider this a mathematics questions because I am building a library that allows perspectival distortions projected over a map.

here is an example of the action I am describing

The action is built with math formulas written for both the scale and rotate aspect:

scaleBy: function(scale) {
  var map = this._map;
  var center = map.project(this.getCenter());
  var p;
  var scaledCorners = {0: '', 1: '', 2: '', 3: ''};

  for (var i = 0; i < 4; i++) {
    p = map
      .project(this.getCorner(i))
      .subtract(center)
      .multiplyBy(scale)
      .add(center);
    scaledCorners[i] = map.unproject(p);
  }

  this.setCorners(scaledCorners);

  return this;
},

rotateBy: function(angle) {
  var map = this._map;
  var center = map.project(this.getCenter());
  var corners = {0: '', 1: '', 2: '', 3: ''};
  var p;
  var q;

  for (var i = 0; i < 4; i++) {
    p = map.project(this.getCorner(i)).subtract(center);
    q = L.point(
      Math.cos(angle) * p.x - Math.sin(angle) * p.y,
      Math.sin(angle) * p.x + Math.cos(angle) * p.y
    );
    corners[i] = map.unproject(q.add(center));
  }

  this.setCorners(corners);

  return this;
},

I currently refer to the action as rotateScale, but there has to be a mathematical term for this? And possibly a formula for the optimal way to combine these actions (currently just calling rotateBy, then scaleBy immediately after.)

Have considered transformation matrices and those are off the table because they are reserved for handling map projection logic.

What you call this? Considered FreeScale, FreeRotate, both not really accurate