Center of gravity between 2 points
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
martin martin
am 19 Mär. 2019
Bearbeitet: Andrei Bobrov
am 19 Mär. 2019
Hello guys,
do you know about simple way how to calculate position of center of gravity between two points? For example first value has 10 kg and second 20 kg.
x = [1 3]
y = [2 5]
v = [10 20]
plot(x,y)
hold on
scatter(x,y,100,v,'filled')
axis image
colorbar
colormap winter
axis([x(1)-1 x(2)+1 y(1)-1 y(2)+1])
![teziste.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/209205/teziste.png)
0 Kommentare
Akzeptierte Antwort
Andrei Bobrov
am 19 Mär. 2019
Bearbeitet: Andrei Bobrov
am 19 Mär. 2019
x = [1 3];
y = [2 5];
v = [10 20];
xc = sum(v.*x)/sum(v);
yc = sum(v.*y)/sum(v);
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Colormaps finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!