add get circle radian point fun

This commit is contained in:
jiaming 2018-12-12 18:47:47 +08:00
parent 1acb4e7943
commit 1d06a1f1f0
1 changed files with 8 additions and 1 deletions

View File

@ -140,6 +140,12 @@ export function getLinearGradientColor (ctx, begin, end, color) {
return linearGradientColor return linearGradientColor
} }
export function getCircleRadianPoint (x, y, radius, radian) {
const { sin, cos } = Math
return [x + cos(radian) * radius, y + sin(radian) * radius]
}
const canvas = { const canvas = {
drawLine, drawLine,
drawPolylinePath, drawPolylinePath,
@ -149,7 +155,8 @@ const canvas = {
drawSmoothline, drawSmoothline,
drawBezierCurveLinePath, drawBezierCurveLinePath,
drawPoints, drawPoints,
getLinearGradientColor getLinearGradientColor,
getCircleRadianPoint
} }
export default function (Vue) { export default function (Vue) {