def vector_attenuation(h_units, lengths)
      raise ArgumentError, "Incosistent arguments. Expected both NArrays to have the same length, go #{h_units.length} and #{lengths.length}" if h_units.length != lengths.length
      # Note that the lengths are converted to units of cm in the calculation.
      # The exponential gives transmission: To get attenuation we subtract from one:
      1 - Math.exp(-(attenuation_coefficients(h_units) * 0.1 * lengths).sum)
    end
def vector_attenuation(h_units, lengths)
      raise ArgumentError, "Incosistent arguments. Expected both NArrays to have the same length, go #{h_units.length} and #{lengths.length}" if h_units.length != lengths.length
      # Note that the lengths are converted to units of cm in the calculation.
      # The exponential gives transmission: To get attenuation we subtract from one:
      1 - Math.exp(-(attenuation_coefficients(h_units) * 0.1 * lengths).sum)
    end
Calculates the attentuation for a vector pair of hounsfield units and lengths.

 @param [NArray<Integer>] h_units a vector of Hounsfield units
 @param [NArray<Float>] lengths a vector of lengths (in units of mm)
 @return [Float] the calculated attenuation of a ray through the given medium