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

Method rotate

src/openlayers/overlay/HeatMap.js:355–359  ·  view source on GitHub ↗

* @function HeatMap.prototype.rotate * @description 获取某像素坐标点 pixelP 绕中心 center 逆时针旋转 rotation 弧度后的像素点坐标。 * @param {number} pixelP - 像素坐标点位置。 * @param {number} rotation - 旋转角度。 * @param {number} center - 中心位置。

(pixelP, rotation, center)

Source from the content-addressed store, hash-verified

353 * @param {number} center - 中心位置。
354 */
355 rotate(pixelP, rotation, center) {
356 var x = Math.cos(rotation) * (pixelP[0] - center[0]) - Math.sin(rotation) * (pixelP[1] - center[1]) + center[0];
357 var y = Math.sin(rotation) * (pixelP[0] - center[0]) + Math.cos(rotation) * (pixelP[1] - center[1]) + center[1];
358 return [x, y];
359 }
360
361 /**
362 * @function HeatMap.prototype.scale

Callers 15

getLocalXYMethod · 0.95
MatrixSpec.jsFile · 0.45
UnicodeMarker.jsFile · 0.45
TextSymbolizer.jsFile · 0.45
$iFunction · 0.45
mapbox-gl.jsFile · 0.45
mapv.3d.jsFile · 0.45
mapv.min.jsFile · 0.45
AtFunction · 0.45
mapv.jsFile · 0.45
drawItemFunction · 0.45
aiFunction · 0.45

Calls 2

cosMethod · 0.80
sinMethod · 0.80

Tested by

no test coverage detected