Center of gravity between 2 points

3 ビュー (過去 30 日間)
martin martin
martin martin 2019 年 3 月 19 日
編集済み: Andrei Bobrov 2019 年 3 月 19 日
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

採用された回答

Andrei Bobrov
Andrei Bobrov 2019 年 3 月 19 日
編集済み: Andrei Bobrov 2019 年 3 月 19 日
x = [1 3];
y = [2 5];
v = [10 20];
xc = sum(v.*x)/sum(v);
yc = sum(v.*y)/sum(v);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeColormaps についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by