* @function Theme.prototype.rotate * @description 获取某像素坐标点 pixelP 绕中心 center 逆时针旋转 rotation 弧度后的像素点坐标。 * @param {number} pixelP - 像素坐标点位置。 * @param {number} rotation - 旋转角度。 * @param {number} center - 中心位置。 * @returns {Array. } 旋转后的像素坐标数组。
(pixelP, rotation, center)
| 506 | * @returns {Array.<number>} 旋转后的像素坐标数组。 |
| 507 | */ |
| 508 | rotate(pixelP, rotation, center) { |
| 509 | var x = Math.cos(rotation) * (pixelP[0] - center[0]) - Math.sin(rotation) * (pixelP[1] - center[1]) + center[0]; |
| 510 | var y = Math.sin(rotation) * (pixelP[0] - center[0]) + Math.cos(rotation) * (pixelP[1] - center[1]) + center[1]; |
| 511 | return [x, y]; |
| 512 | } |
| 513 | |
| 514 | /** |
| 515 | * @function Theme.prototype.scale |
no test coverage detected