MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / rotate

Method rotate

src/common/overlay/levelRenderer/Matrix.js:116–133  ·  view source on GitHub ↗

* @function LevelRenderer.Tool.Matrix.prototype.rotate * @description 平移变换。 * @param {(Float32Array|Array. )} out - 单位矩阵。 * @param {(Float32Array|Array. )} a - 矩阵。 * @param {(Float32Array|Array. )} rad - 旋转参数。 * @returns {(Float32Array|Array. )} 结

(out, a, rad)

Source from the content-addressed store, hash-verified

114 * @returns {(Float32Array|Array.<number>)} 结果矩阵。
115 */
116 rotate(out, a, rad) {
117 var aa = a[0];
118 var ac = a[2];
119 var atx = a[4];
120 var ab = a[1];
121 var ad = a[3];
122 var aty = a[5];
123 var st = Math.sin(rad);
124 var ct = Math.cos(rad);
125
126 out[0] = aa * ct + ab * st;
127 out[1] = -aa * st + ab * ct;
128 out[2] = ac * ct + ad * st;
129 out[3] = -ac * st + ct * ad;
130 out[4] = ct * atx + st * aty;
131 out[5] = ct * aty - st * atx;
132 return out;
133 }
134
135 /**
136 * @function LevelRenderer.Tool.Matrix.prototype.scale

Callers 4

getChangedImageUrlFunction · 0.45
brushMethod · 0.45
updateTransformMethod · 0.45

Calls 2

sinMethod · 0.80
cosMethod · 0.80

Tested by

no test coverage detected