{"ast":null,"code":"'use strict';\n/*\n * Compute the tangent vector according to catmull-rom cubic splines (centripetal,\n * I think). That differs from the control point in two ways:\n *   1. It is a vector, not a position relative to the point\n *   2. the vector is longer than the position relative to p1 by a factor of 3\n *\n * Close to the boundaries, we'll use these as *quadratic control points, so that\n * to make a nice grid, we'll need to divide the tangent by 2 instead of 3. (The\n * math works out this way if you work through the bezier derivatives)\n */\n\nvar CatmullRomExp = 0.5;\n\nmodule.exports = function makeControlPoints(p0, p1, p2, smoothness) {\n  var d1x = p0[0] - p1[0];\n  var d1y = p0[1] - p1[1];\n  var d2x = p2[0] - p1[0];\n  var d2y = p2[1] - p1[1];\n  var d1a = Math.pow(d1x * d1x + d1y * d1y, CatmullRomExp / 2);\n  var d2a = Math.pow(d2x * d2x + d2y * d2y, CatmullRomExp / 2);\n  var numx = (d2a * d2a * d1x - d1a * d1a * d2x) * smoothness;\n  var numy = (d2a * d2a * d1y - d1a * d1a * d2y) * smoothness;\n  var denom1 = d2a * (d1a + d2a) * 3;\n  var denom2 = d1a * (d1a + d2a) * 3;\n  return [[p1[0] + (denom1 && numx / denom1), p1[1] + (denom1 && numy / denom1)], [p1[0] - (denom2 && numx / denom2), p1[1] - (denom2 && numy / denom2)]];\n};","map":{"version":3,"sources":["C:/Projects/reactApp/analyse_coderhub/node_modules/plotly.js/src/traces/carpet/catmull_rom.js"],"names":["CatmullRomExp","module","exports","makeControlPoints","p0","p1","p2","smoothness","d1x","d1y","d2x","d2y","d1a","Math","pow","d2a","numx","numy","denom1","denom2"],"mappings":"AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,IAAIA,aAAa,GAAG,GAApB;;AACAC,MAAM,CAACC,OAAP,GAAiB,SAASC,iBAAT,CAA2BC,EAA3B,EAA+BC,EAA/B,EAAmCC,EAAnC,EAAuCC,UAAvC,EAAmD;AAChE,MAAIC,GAAG,GAAGJ,EAAE,CAAC,CAAD,CAAF,GAAQC,EAAE,CAAC,CAA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AA1B,CAFD,CAHI,CAAP;AAOH,CAnBD","sourcesContent":["'use strict';\n\n/*\n * Compute the tangent vector according to catmull-rom cubic splines (centripetal,\n * I think). That differs from the control point in two ways:\n *   1. It is a vector, not a position relative to the point\n *   2. the vector is longer than the position relative to p1 by a factor of 3\n *\n * Close to the boundaries, we'll use these as *quadratic control points, so that\n * to make a nice grid, we'll need to divide the tangent by 2 instead of 3. (The\n * math works out this way if you work through the bezier derivatives)\n */\nvar CatmullRomExp = 0.5;\nmodule.exports = function makeControlPoints(p0, p1, p2, smoothness) {\n    var d1x = p0[0] - p1[0];\n    var d1y = p0[1] - p1[1];\n    var d2x = p2[0] - p1[0];\n    var d2y = p2[1] - p1[1];\n    var d1a = Math.pow(d1x * d1x + d1y * d1y, CatmullRomExp / 2);\n    var d2a = Math.pow(d2x * d2x + d2y * d2y, CatmullRomExp / 2);\n    var numx = (d2a * d2a * d1x - d1a * d1a * d2x) * smoothness;\n    var numy = (d2a * d2a * d1y - d1a * d1a * d2y) * smoothness;\n    var denom1 = d2a * (d1a + d2a) * 3;\n    var denom2 = d1a * (d1a + d2a) * 3;\n\n    return [[\n        p1[0] + (denom1 && numx / denom1),\n        p1[1] + (denom1 && numy / denom1)\n    ], [\n        p1[0] - (denom2 && numx / denom2),\n        p1[1] - (denom2 && numy / denom2)\n    ]];\n};\n"]},"metadata":{},"sourceType":"script"}