public override object MeasurePlant(PlantInfo plant) { double totalLaterals = 0.0; double totalAngle = 0.0; foreach (RootInfo info in plant) { if (info.Spline != null) { if (plant.GetParent(info) == null) { totalAngle += Math.Abs((double)rootEmergenceHandler.MeasureRoot(info, plant.GetParent(info))); totalLaterals++; } } } if (totalLaterals > 0) { return(Math.Round(totalAngle / totalLaterals, 2)); } else { return(null); } }