Difference between revisions of "Centroid Command"

From GeoGebra Manual
Jump to: navigation, search
m
(command syntax: changed [ ] into ( ))
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<noinclude>{{Manual Page|version=5.0}}</noinclude>
+
<noinclude>{{Manual Page|version=5.0}}</noinclude>{{command|geometry}}
{{command|geometry}}
+
;Centroid( <Polygon> ):Returns the centroid of the polygon.
;Centroid[ <Polygon> ]:Returns the centroid of the polygon.
+
:{{example|1=<div>Let <code><nowiki>A = (1, 4)</nowiki></code>, <code><nowiki>B = (1, 1)</nowiki></code>, <code><nowiki>C = (5, 1)</nowiki></code> and <code><nowiki>D = (5, 4)</nowiki></code> be the vertices of a polygon.  <code><nowiki>Polygon(A, B, C, D)</nowiki></code> yields ''poly1 = 12''. <code><nowiki>Centroid(poly1)</nowiki></code> yields the centroid ''E = (3, 2.5)''.</div>}}
:{{example|1=<div>Let <code><nowiki>A = (1, 4)</nowiki></code>, <code><nowiki>B = (1, 1)</nowiki></code>, <code><nowiki>C = (5, 1)</nowiki></code> and <code><nowiki>D = (5, 4)</nowiki></code> be the vertices of a polygon.  <code><nowiki>Polygon[ A, B, C, D ]</nowiki></code> yields ''poly1 = 12''. <code><nowiki>Centroid[ poly1 ]</nowiki></code> yields the centroid ''E = (3, 2.5)''.</div>}}
 

Latest revision as of 10:02, 11 October 2017


Centroid( <Polygon> )
Returns the centroid of the polygon.
Example:
Let A = (1, 4), B = (1, 1), C = (5, 1) and D = (5, 4) be the vertices of a polygon. Polygon(A, B, C, D) yields poly1 = 12. Centroid(poly1) yields the centroid E = (3, 2.5).
© 2024 International GeoGebra Institute