MCPcopy Create free account
hub / github.com/plotly/plotly.js / calcIntersection

Function calcIntersection

src/traces/isosurface/convert.js:349–362  ·  view source on GitHub ↗
(pointOut, pointIn, min, max)

Source from the content-addressed store, hash-verified

347 }
348
349 function calcIntersection(pointOut, pointIn, min, max) {
350 var value = pointOut[3];
351
352 if(value < min) value = min;
353 if(value > max) value = max;
354
355 var ratio = (pointOut[3] - value) / (pointOut[3] - pointIn[3] + 0.000000001); // we had to add this error to force solve the tiny caps
356
357 var result = [];
358 for(var s = 0; s < 4; s++) {
359 result[s] = (1 - ratio) * pointOut[s] + ratio * pointIn[s];
360 }
361 return result;
362 }
363
364 function inRange(value, min, max) {
365 return (

Callers 2

tryCreateTriFunction · 0.85
tryCreateTetraFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…