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

Function isInAngleRange

front/components/u-charts/u-charts.js:194–214  ·  view source on GitHub ↗
(angle, startAngle, endAngle)

Source from the content-addressed store, hash-verified

192}
193
194function isInAngleRange(angle, startAngle, endAngle) {
195 function adjust(angle) {
196 while (angle < 0) {
197 angle += 2 * Math.PI;
198 }
199 while (angle > 2 * Math.PI) {
200 angle -= 2 * Math.PI;
201 }
202 return angle;
203 }
204 angle = adjust(angle);
205 startAngle = adjust(startAngle);
206 endAngle = adjust(endAngle);
207 if (startAngle > endAngle) {
208 endAngle += 2 * Math.PI;
209 if (angle < startAngle) {
210 angle += 2 * Math.PI;
211 }
212 }
213 return angle >= startAngle && angle <= endAngle;
214}
215
216function calRotateTranslate(x, y, h) {
217 var xv = x;

Callers 1

findPieChartCurrentIndexFunction · 0.85

Calls 1

adjustFunction · 0.85

Tested by

no test coverage detected