查找带加权顶点的多边形的质心 [英] Find the centroid of a polygon with weighted vertices

查看:122
本文介绍了查找带加权顶点的多边形的质心的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道如何找到正多边形的质心(质心)。这假设多边形的每个部分重量相同。
但我该如何计算一个没有重量的多边形(由气凝胶制成)的质心,其中每个顶点都有一个重量?



意思是用直线表示:

  5kg ----------------- 5kg 
^重心

10kg --------------- 5kg
^重心偏移du对顶点的权重

当然,我知道如何在具有加权顶点的直线上计算重心,但我该如何操作在具有加权顶点的多边形上?



感谢您的时间!

解决方案

你想对所有顶点进行加权平均。所以说你的顶点是质量为m1,m2 ... mn的v1,v2,v3 .... vn,并且有x和y坐标v1x,v1y,v2x,v2y等,然后得到质心(cx,cy)你想:

pre code> cx =(v1x * m1 + v2x * m2 + ... vnx * mn)/(m1 + m2 ... mn)
cy =(v1y * m1 + v2y * m2 + ... vny * mn)/(m1 + m2 .... mn)



它基本上与您为一条线做同样的原则。


I know how to find the centroid (center of mass) of a regular polygon. This assumes that every part of the polygon weighs the same. But how do I calculate the centroid of a weightless polygon (made from aerogel perhaps :), where each vertex has a weight?

Simplified illustration of what I mean using straight line:

5kg-----------------5kg
           ^center of gravity

10kg---------------5kg
        ^center of gravity offset du to weight of vertices

Of course, I know how to calculate the center of gravity on a straight line with weighted vertices, but how do I do it on a polygon with weighted vertices?

Thanks for your time!

解决方案

You want take a weighted average over all the vertices. So say your vertices are v1, v2, v3 .... vn with masses m1, m2 ...mn and have x and y coordinates v1x, v1y, v2x, v2y etc then to get the center of mass (cx, cy) you want:

cx = (v1x*m1 + v2x*m2 + ... vnx*mn) / (m1 + m2 .... mn) 
cy = (v1y*m1 + v2y*m2 + ... vny*mn) / (m1 + m2 .... mn)

It's essentially the same principle as when you do it for a line.

这篇关于查找带加权顶点的多边形的质心的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆