func MMI(depth, magnitude float64) float64 {
	var w, m float64
	d := math.Abs(depth)
	rupture := d

	if d < 100 {
		w = math.Min(0.5*math.Pow(10, magnitude-5.39), 30.0)
		rupture = math.Max(d-0.5*w*0.85, 0.0)
	}

	if d < 70.0 {
		m = 4.40 + 1.26*magnitude - 3.67*math.Log10(rupture*rupture*rupture+1634.691752)/3.0 + 0.012*d + 0.409
	} else {
		m = 3.76 + 1.48*magnitude - 3.50*math.Log10(rupture*rupture*rupture)/3.0 + 0.0031*d
	}

	if m < 3.0 {
		m = -1.0
	}

	return m
}
// MMI calculates the maximum Modificed Mercalli Intensity for the quake.
// depth is in km.
MMI calculates the maximum Modificed Mercalli Intensity for the quake.
depth is in km.
// MMI calculates the maximum Modificed Mercalli Intensity for the quake . // depth is in km .
func MMI(depth, magnitude float64) float64 {
	var w, m float64
	d := math.Abs(depth)
	rupture := d
	if d < 100 {
		w = math.Min(0.5*math.Pow(10, magnitude-5.39), 30.0)
		rupture = math.Max(d-0.5*w*0.85, 0.0)
	}
	if d < 70.0 {
		m = 4.40 + 1.26*magnitude - 3.67*math.Log10(rupture*rupture*rupture+1634.691752)/3.0 + 0.012*d + 0.409
	} else {
		m = 3.76 + 1.48*magnitude - 3.50*math.Log10(rupture*rupture*rupture)/3.0 + 0.0031*d
	}
	if m < 3.0 {
		m = -1.0
	}
	return m
}
func MMI ( depth , magnitude float64 ) float64 { var w , m float64 d := math . Abs ( depth ) rupture := d if d < 100 { w = math . Min ( 0.5 * math . Pow ( 10 , magnitude - 5.39 ) , 30.0 ) rupture = math . Max ( d - 0.5 * w * 0.85 , 0.0 ) } if d < 70.0 { m = 4.40 + 1.26 * magnitude - 3.67 * math . Log10 ( rupture * rupture * rupture + 1634.691752 ) / 3.0 + 0.012 * d + 0.409 } else { m = 3.76 + 1.48 * magnitude - 3.50 * math . Log10 ( rupture * rupture * rupture ) / 3.0 + 0.0031 * d } if m < 3.0 { m = - 1.0 } return m }
MMI calculates the maximum Modificed Mercalli Intensity for the quake.
MMI calculates the maximum Modificed Mercalli Intensity for the quake .