neurom.morphmath.interpolate_radius

neurom.morphmath.interpolate_radius(r1, r2, fraction)[source]

Calculate the radius that corresponds to a point P that lies at a fraction of the length of a cut cone P1P2 where P1, P2 are the centers of the circles that bound the shape with radii r1 and r2 respectively.

Parameters:
  • r1 – float Radius of the first node of the segment.
  • r2 – float Radius of the second node of the segment
  • fraction – float The fraction at which the interpolated radius is calculated.
Returns: float
The interpolated radius.

Note: The fraction is assumed from point P1, not from point P2.