Return the hydraulic radius.

    Width and DistCenter are length values and openchannel is a boolean.
774561
def radius_hydraulic(Width, DistCenter, openchannel):
    
    ut.check_range([Width, ">0", "Width"], [DistCenter, ">0", "DistCenter"],
                   [openchannel, "boolean", "openchannel"])
    if openchannel:
        return (Width*DistCenter) / (Width + 2*DistCenter)
        # if openchannel is True, the channel is open. Otherwise, the channel
        # is assumed to have a top.
    else:
        return (Width*DistCenter) / (2 * (Width+DistCenter))
1346177
private static double getSideLengthFromInscribedRadius(double radius, int n) {
		if (n == 2) {
			return radius;
		}
		return radius * 2 * Math.tan(Math.PI/n);
	}
638964
def dev_size(self, units="MiB"):
        
        self.open()
        size = lvm_pv_get_dev_size(self.handle)
        self.close()
        return size_convert(size, units)
1027044
def volume(self):
        
        volume = ((np.pi * self.primitive.radius ** 2) *
                  self.primitive.height)
        return volume
148823
def diam_pipemajor(FlowRate, HeadLossFric, Length, Nu, PipeRough):
    
    #Inputs do not need to be checked here because they are checked by
    #functions this function calls.
    DiamLaminar = diam_hagen(FlowRate, HeadLossFric, Length, Nu).magnitude
    if re_pipe(FlowRate, DiamLaminar, Nu) <= RE_TRANSITION_PIPE:
        return DiamLaminar
    else:
        return diam_swamee(FlowRate, HeadLossFric, Length,
                           Nu, PipeRough).magnitude
304772
protected function getTerminalWidth()
    {
        // from environment
        if (isset($_SERVER['COLUMNS'])) return (int)$_SERVER['COLUMNS'];

        // via tput
        $process = proc_open('tput cols', array(
            1 => array('pipe', 'w'),
            2 => array('pipe', 'w'),
        ), $pipes);
        $width = (int)stream_get_contents($pipes[1]);
        proc_close($process);

        return $width;
    }
1140568
def summary_width(self):
        
        chunk_counts = [chunk.count for chunk in self._progress_chunks]
        numbers_width = sum(max(1, ceil(log10(count + 1)))
                            for count in chunk_counts)
        separators_with = len(chunk_counts) - 1
        return numbers_width + separators_with
872556
def flow_orifice(Diam, Height, RatioVCOrifice):
    """"""
    #Checking input validity
    ut.check_range([Diam, ">0", "Diameter"],
                   [RatioVCOrifice, "0-1", "VC orifice ratio"])
    if Height > 0:
        return (RatioVCOrifice * area_circle(Diam).magnitude
                * np.sqrt(2 * gravity.magnitude * Height))
    else:
        return 0
975089
def sc_dist(self, viewer, event, msg=True):
        
        direction = self.get_direction(event.direction)
        self._cycle_dist(viewer, msg, direction=direction)
        return True
564861
function getLengthInternal(coordinates, radius) {
  let length = 0;
  for (let i = 0, ii = coordinates.length; i < ii - 1; ++i) {
    length += getDistance(coordinates[i], coordinates[i + 1], radius);
  }
  return length;
}
501870
private static double getSideLengthFromCircumscribedRadius(double radius, int n) {
		if (n == 2) {
			return radius;
		}
		return radius * (2 * Math.sin(Math.PI/n));
	}
456171
def dilate_obs(self, dilation_radius):
        
        for s in self.size_thresholds:
            self.dilated_obs[s] = np.zeros(self.window_obs[self.mrms_variable].shape)
            for t in range(self.dilated_obs[s].shape[0]):
                self.dilated_obs[s][t][binary_dilation(self.window_obs[self.mrms_variable][t] >= s, iterations=dilation_radius)] = 1
119127
def diameter(self):
        '''
        '''
        d = dict(); best = float('-inf')
        for node in self.traverse_postorder():
            if node.is_leaf():
                d[node] = 0
            else:
                dists = sorted(d[c]+c.edge_length for c in node.children)
                d[node] = dists[-1]; max_pair = dists[-1]+dists[-2]
                if max_pair > best:
                    best = max_pair
        return best
40269
def width(self, add_quiet_zone=False):
        
        quiet_zone = self.quiet_zone if add_quiet_zone else 0
        return len(self.modules) + 2 * quiet_zone
1311498
def orifice_diameter(self):
        
        maxdrill = min(self.b_rows, self.d_orifice_max)
        return ut.floor_nearest(maxdrill, self.drill_bits)
1198814
def console_get_width(con: tcod.console.Console) -> int:
    
    return int(lib.TCOD_console_get_width(_console(con)))
1179680
def signedDistance(actor, maxradius=0.5, bounds=(0, 1, 0, 1, 0, 1), dims=(10, 10, 10)):
    
    dist = vtk.vtkSignedDistance()
    dist.SetInputData(actor.polydata(True))
    dist.SetRadius(maxradius)
    dist.SetBounds(bounds)
    dist.SetDimensions(dims)
    dist.Update()
    return Volume(dist.GetOutput())