04-10-2015, 05:10 AM
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 ]]
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 ]]