Calculation of centroids of compound figures

버전 1.1 (1.57 KB) 작성자: Pedro Guevara
This simple application allows you to calculate the centroids of the polygonal composite figures you want.
다운로드 수: 35
업데이트 날짜: 2020/2/22

라이선스 보기

This simple application allows you to calculate the centroids of the polygonal composite figures you want. Consider the number of figures entered and create them using the "polyshape" function using the Cartesian coordinates entered for each figure. The centroid of the figure is calculated using the "centroid" function that is typical of MATLAB.

To exemplify its use I leave the following example:

Suppose I want to calculate the centroid of a figure composed of a rectangle 20 in height and 30 in width, and on the left side of that rectangle is a semicircle of radius of 10, and whose diameter coincides with the height of the rectangle.

The data entry would be as follows:

>> centroids
Number of polygons =:
2
This poligo is a circ arc? 1 = Yes or 2 = No: % press 1 if the polygon is an arc of circumference, or 2 if it is not.
2
Vert number = % number of coordinates and entering them for the rectangle
4
Vx1 = 0
Vy1 = 0
Vx2 = 0
Vy2 = 20
Vx3 = 30
Vy3 = 20
Vx4 = 30
Vy4 = 0

This poligo is a circ arc? 1 = Yes or 2 = No: % press 1 if the polygon is an arc of circumference, or 2 if it is not.
1
% Data entry for the semi circumference.

radius =
10
Ori_X =
0
Ori_Y =
10
Ang_ini =
90
Ang_fin =
270

xc = 11.08
yc = 10

It is my first contribution to the page. I hope they are not very hard on me. Thanks for your attention.

인용 양식

Pedro Guevara (2024). Calculation of centroids of compound figures (https://www.mathworks.com/matlabcentral/fileexchange/74318-calculation-of-centroids-of-compound-figures), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2017b
R2017b에서 R2019b까지의 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Elementary Polygons에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.1

Label text in centroids.

1.0.0