val mass:Float = bodies.foldLeft(0f)((x:Float,b:Body)=>x+b.mass)
val massX:Float = bodies.foldLeft(0f)((mx:Float,b:Body)=>(mx + b.x*b.mass)) / mass
val massY:Float = bodies.foldLeft(0f)((my:Float,b:Body)=>(my + b.y*b.mass)) / mass
--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
To unsubscribe from this group and stop receiving emails from it, send an email to scala-user+...@googlegroups.com.