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

Function solveIntersection

stackgl_modules/index.js:9281–9299  ·  view source on GitHub ↗
(a, b, c, d)

Source from the content-addressed store, hash-verified

9279// t = (d-c)^(a-c) / (b-a)^(d-c)
9280
9281function solveIntersection (a, b, c, d) {
9282 var ba = rvSub(b, a)
9283 var dc = rvSub(d, c)
9284
9285 var baXdc = ratPerp(ba, dc)
9286
9287 if (ratSign(baXdc) === 0) {
9288 return null
9289 }
9290
9291 var ac = rvSub(a, c)
9292 var dcXac = ratPerp(dc, ac)
9293
9294 var t = ratDiv(dcXac, baXdc)
9295 var s = rvMuls(ba, t)
9296 var r = rvAdd(a, s)
9297
9298 return r
9299}
9300
9301
9302/***/ }),

Callers 1

cutEdgesFunction · 0.85

Calls 1

ratPerpFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…