MCPcopy Create free account
hub / github.com/ColdGrub1384/Pyto / interp

Method interp

site-packages/matplotlib/tri/_tri.cpp:980–992  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

978}
979
980XY TriContourGenerator::interp(int point1,
981 int point2,
982 const double& level) const
983{
984 assert(point1 >= 0 && point1 < _triangulation.get_npoints() &&
985 "Point index 1 out of bounds.");
986 assert(point2 >= 0 && point2 < _triangulation.get_npoints() &&
987 "Point index 2 out of bounds.");
988 assert(point1 != point2 && "Identical points");
989 double fraction = (get_z(point2) - level) / (get_z(point2) - get_z(point1));
990 return _triangulation.get_point_coords(point1)*fraction +
991 _triangulation.get_point_coords(point2)*(1.0 - fraction);
992}
993
994
995

Callers 6

recacheMethod · 0.80
get_interp_pointMethod · 0.80
interpolate_1dFunction · 0.80

Calls 4

assertFunction · 0.85
get_zFunction · 0.85
get_npointsMethod · 0.80
get_point_coordsMethod · 0.80

Tested by 1