MCPcopy Index your code
hub / github.com/plotly/plotly.js / isPtInsideSector

Function isPtInsideSector

src/lib/angles.js:89–103  ·  view source on GitHub ↗

* is pt (r,a) inside sector? * * @param {number} r : pt's radial coordinate * @param {number} a : pt's angular coordinate in *radians* * @param {2-item array} rBnds : sector's radial bounds * @param {2-item array} aBnds : sector's angular bounds in *radians* * @return {boolean}

(r, a, rBnds, aBnds)

Source from the content-addressed store, hash-verified

87 * @return {boolean}
88 */
89function isPtInsideSector(r, a, rBnds, aBnds) {
90 if(!isAngleInsideSector(a, aBnds)) return false;
91
92 var r0, r1;
93
94 if(rBnds[0] < rBnds[1]) {
95 r0 = rBnds[0];
96 r1 = rBnds[1];
97 } else {
98 r0 = rBnds[1];
99 r1 = rBnds[0];
100 }
101
102 return r >= r0 && r <= r1;
103}
104
105// common to pathArc, pathSector and pathAnnulus
106function _path(r0, r1, a0, a1, cx, cy, isClosed) {

Callers

nothing calls this directly

Calls 1

isAngleInsideSectorFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…