comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Center of mass???
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Center of mass??? [message #17756 is a reply to message #17710] Thu, 11 November 1999 00:00 Go to previous messageGo to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Anders Wennerberg (anders@mrc.ks.se) writes:

> Thanks for the help!

> David Fanning wrote:
>
>> Paul Hick (pphick@ucsd.edu) writes:
>>
>>> Reasoning by analogy to the 2D case, this should work, I think:
>>>
>>> xcm = Total( Total(Total(array,3),2) * Indgen(s[0])) / totalMass
>>> ycm = Total( Total(Total(array,3),1) * Indgen(s[1])) / totalMass
>>> zcm = Total( Total(Total(array,2),1) * Indgen(s[2])) / totalMass

Well, I'll say this for the simple-minded approach:
it apparently works. :-)

Cheers,

David

P.S. Let's just say I'm still scratching my head
and getting a headache sorting through JD's more
general approach to the problem. I wish I would
have paid more attention in those math classes
way back when. I was still trying to get through
the Alice in Wonderland required reading. :-(

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Object Widgets
Next Topic: Re: where() and IEEE NaN

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 06:22:23 PDT 2025

Total time taken to generate the page: 2.55602 seconds