(s, h, clamp)
| 60 | } |
| 61 | |
| 62 | function convertToCartesian(s, h, clamp) { |
| 63 | if (clamp) { |
| 64 | if (s > 100) s = 100; |
| 65 | } |
| 66 | // convert degrees to radians |
| 67 | let hRad = (h * Math.PI) / 180; |
| 68 | let xAxis = s * Math.cos(hRad); |
| 69 | let yAxis = s * Math.sin(hRad); |
| 70 | |
| 71 | return { |
| 72 | x: xAxis, |
| 73 | y: yAxis |
| 74 | }; |
| 75 | } |
| 76 | |
| 77 | function filterNaN(x) { |
| 78 | if (isNaN(x) || x === undefined) { |
no outgoing calls
no test coverage detected