[Maya-Python] Re: finding average of a list of coordinates

2016-11-24 Thread sam
ok, yea its probably best to do it one another line. I just thought there was a command that computed the center of a list of coords easier than constucting it manually. thanks for the help, Sam -- You received this message because you are subscribed to the Google Groups "Python Programming

[Maya-Python] Re: finding average of a list of coordinates

2016-11-24 Thread fruity
hi, if you want to do it absolutely in one line, maybe something like getCentroid = lambda inputs : [sum([a[x] for a in inputs]) / float(len(inputs)) for x in range(3)] if len(inputs) else None ? Then you can use getCentroid([[1, 0, 0], [0, 1, 0], [-1, 0, 0]]) for example. But why doing it i