def sub_miller(segments):
 fracts = [segment_to_fraction(segment) for segment in segments]
 common_denominator = reduce(lcm, [fract.denominator for fract in fracts])
 miller_indices = [((fract.numerator * math.fabs(common_denominator)) / fract.denominator) for fract in fracts]
 return (('(' + ','.join(map(str, map(decimal.Decimal, miller_indices)))) + ')')

def sub_miller ( segments ) : fracts = [ segment_to_fraction ( segment ) for segment in segments ] common_denominator = reduce ( lcm , [ fract . denominator for fract in fracts ] ) miller_indices = [ ( ( fract . numerator * math . fabs ( common_denominator ) ) / fract . denominator ) for fract in fracts ] return ( ( '(' + ',' . join ( map ( str , map ( decimal . Decimal , miller_indices ) ) ) ) + ')' )
calculates miller indices from segments .