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 #17692] Tue, 09 November 1999 00:00 Go to previous message
Jonathan Joseph is currently offline  Jonathan Joseph
Messages: 69
Registered: September 1998
Member
Well, I'm not going to take up JD's challenge,
but are you all sure you are answering the right
question?

I mean sure, great, if you happen to have
an MxNx.... array of masses then you've got
everything you need. But when I first read
Anders' post, I thought, "gee that sounds simple."

I thought of N masses at N locations,

m = 1D array of N masses
pos = D x N array of locations of the masses in D dimensions

then:

s=size(pos, /dimensions)
mm = m ## replicate(1,s(0))
cm = total(pos * mm, 2) / total(m)

Please someone correct me if I'm wrong.
Also, Is there a better way of multiplying
an MxN array by a one dimensional array of
length N such that each row of the MxN array
is multiplied by the corresponding element
of the one dimensional array?

-Jonathan
[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: Wed Oct 08 14:52:20 PDT 2025

Total time taken to generate the page: 0.00404 seconds