MCPcopy Create free account
hub / github.com/CoderOpen/waimai / getAngle

Method getAngle

front/components/mpvueGestureLock/gestureLock.js:105–113  ·  view source on GitHub ↗
(start, end)

Source from the content-addressed store, hash-verified

103
104 // 获取 画线的 角度
105 getAngle(start, end) {
106 var diff_x = end.x - start.x,
107 diff_y = end.y - start.y;
108 if (diff_x >= 0) {
109 return 360 * Math.atan(diff_y / diff_x) / (2 * Math.PI);
110 } else {
111 return 180 + 360 * Math.atan(diff_y / diff_x) / (2 * Math.PI);
112 }
113 }
114
115 // 判断 当前点是否位于 锁内
116 isPointInCycle(x, y, circleX, circleY, radius) {

Callers 1

drawLineMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected