Post Reply 
(50g) Center of Mass using Matrix
04-10-2015, 05:10 AM (This post was last modified: 06-15-2017 01:33 PM by Gene.)
Post: #1
(50g) Center of Mass using Matrix
Center of Mass using Matrix: CENTERMTX

Link to the original blog entry: [url] http://edspi31415.blogspot.com/2015/04/h....html[/url]

Input:
1: Matrix of Masses

Program:
<< DUP SIZE OBJ→ DROP → M R C
<< M 1 C START 1 NEXT C →ARRY * AXL ∑LIST

M 1 C FOR I I NEXT C 1 2 →LIST →ARRY * TRAN
1 R START 1 NEXT R 1 2 →LIST →ARRY * OBJ→ DROP

M TRAN 1 R FOR I I NEXT R 1 2 →LIST →ARRY * TRAN
1 C START 1 NEXT C 1 2 →LIST →ARRY * OBJ→ DROP

→ tm rw cw
<< rw tm / cw tm / {1,2} →ARRY >> >> >>

Output:
[[ x center of mass point, y center of mass point ]]
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)