MCPcopy Create free account
hub / github.com/adobe/leonardo / convertToCartesian

Function convertToCartesian

docs/ui/src/js/utils.js:62–75  ·  view source on GitHub ↗
(s, h, clamp)

Source from the content-addressed store, hash-verified

60}
61
62function 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
77function filterNaN(x) {
78 if (isNaN(x) || x === undefined) {

Callers 3

createColorDataFunction · 0.90
createColorDataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected