Difference between revisions of "Barycenter Command"

From GeoGebra Manual
Jump to: navigation, search
m
(command syntax: changed [ ] into ( ))
 
(3 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|cas=true|geometry|Barycenter}}
{{command|cas=true|geometry|Barycenter}}
+
;Barycenter( <List of Points>, <List of Weights>  )
;Barycenter[  &lt;List of Points>, &lt;List of Weights>  ]
 
 
:Set the center of a system of points in the list, defined as the average of their positions, weighted by their value, using the [[w:Center of mass|proper formula]].
 
:Set the center of a system of points in the list, defined as the average of their positions, weighted by their value, using the [[w:Center of mass|proper formula]].
  
 
:{{examples|1=<div>
 
:{{examples|1=<div>
:*<code>Barycenter[{(2, 0), (0, 2), (-2, 0), (0, -2)}, {1, 1, 1, 1}]</code> yields point ''A(0, 0)''
+
:*<code>Barycenter({(2, 0), (0, 2), (-2, 0), (0, -2)}, {1, 1, 1, 1})</code> yields point ''A(0, 0)''
:*<code>Barycenter[{(2, 0), (0, 2), (-2, 0), (0, -2)}, {2, 1, 1, 1}]</code> yields point ''B(0.4, 0)''. The ''x''-coordinate of this point was determined by '' <math> \frac{1}{ 2+1+1+1 }*(2*2+1*0+1*(-2)+1*0)</math> = <math>\frac{1}{ 5 }*2</math> = 0.4''</div>}}
+
:*<code>Barycenter({(2, 0), (0, 2), (-2, 0), (0, -2)}, {2, 1, 1, 1})</code> yields point ''B(0.4, 0)''. The ''x''-coordinate of this point was determined by '' <math> \frac{1}{ 2+1+1+1 }*(2*2+1*0+1*(-2)+1*0)</math> = <math>\frac{1}{ 5 }*2</math> = 0.4''</div>}}

Latest revision as of 09:01, 11 October 2017


Barycenter( <List of Points>, <List of Weights> )
Set the center of a system of points in the list, defined as the average of their positions, weighted by their value, using the proper formula.
Examples:
  • Barycenter({(2, 0), (0, 2), (-2, 0), (0, -2)}, {1, 1, 1, 1}) yields point A(0, 0)
  • Barycenter({(2, 0), (0, 2), (-2, 0), (0, -2)}, {2, 1, 1, 1}) yields point B(0.4, 0). The x-coordinate of this point was determined by \frac{1}{ 2+1+1+1 }*(2*2+1*0+1*(-2)+1*0) = \frac{1}{ 5 }*2 = 0.4
© 2024 International GeoGebra Institute