<?xml version="1.0" encoding="UTF-8"?>
	<rss version="2.0"
		xmlns:content="http://purl.org/rss/1.0/modules/content/"
		xmlns:wfw="http://wellformedweb.org/CommentAPI/"
		xmlns:dc="http://purl.org/dc/elements/1.1/"
		xmlns:atom="http://www.w3.org/2005/Atom"

			>

	<channel>
		<title>Cycling 74  &#187;  Topic: centroid?</title>
		<atom:link href="http://cycling74.com/forums/topic/centroid/feed" rel="self" type="application/rss+xml" />
		<link>http://cycling74.com/forums/topic/centroid/feed</link>
		<description></description>
		<pubDate>Wed, 19 Jun 2013 15:38:05 +0000</pubDate>
		<generator>http://bbpress.org/?v=2.2.4</generator>
		<language></language>

		
														
					
				<item>
					<guid>http://cycling74.com/forums/topic/centroid/#post-31309</guid>
					<title><![CDATA[centroid?]]></title>
					<link>http://cycling74.com/forums/topic/centroid/#post-31309</link>
					<pubDate>Wed, 11 Apr 2007 13:36:26 +0000</pubDate>
					<dc:creator>jbm</dc:creator>

					<description>
						<![CDATA[
						<p>This is kind of embarrassing, but can anybody write out, in plain English, the centroid equation? I know there&#8217;s a snappy one in Lcent, but I need to do it in java, and I can&#8217;t work out how to get Dr. Elsea&#8217;s little equation to work&#8230; I&#8217;m not a mathematician by any stretch of the imagination, so all the equations I&#8217;ve found online wind up giving me some funky characters that are truly Greek to me (literally). Ssomething like &#8220;sum the list, take the average, and&#8230;&#8221; as an explanation would be brilliant.</p>
<p>Thanks in advance.</p>
<p>J.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/centroid/#post-101587</guid>
					<title><![CDATA[Re: centroid?]]></title>
					<link>http://cycling74.com/forums/topic/centroid/#post-101587</link>
					<pubDate>Wed, 11 Apr 2007 15:01:08 +0000</pubDate>
					<dc:creator>Owen Green</dc:creator>

					<description>
						<![CDATA[
						<p>Hi,</p>
<p>I think it&#8217;s like a weighted mean of the list values against its indices.</p>
<p>So&#8230;</p>
<p>1) compute the sum of each list element multiplied by its index <br />
(presumably indexing from 1, not zero)</p>
<p>2) compute the sum of the list values</p>
<p>3) Divide (1) by (2)</p>
<p>So, something along the lines of:</p>
<p>float weightedsum = 0;<br />
float sum = 0;</p>
<p>for(int i=0; i< mylist.length; i++)<br />
{<br />
   weightedsum += (i+1) * mylist[i];<br />
   sum += mylist[i];<br />
}</p>
<p>return (weightedsum / sum);</p>
<p>&#8211; <br />
Owen</p>
<p>
jbmaxwell wrote:<br />
> This is kind of embarrassing, but can anybody write out, in plain<br />
> English, the centroid equation? I know there&#8217;s a snappy one in Lcent,<br />
> but I need to do it in java, and I can&#8217;t work out how to get Dr.<br />
> Elsea&#8217;s little equation to work&#8230; I&#8217;m not a mathematician by any<br />
> stretch of the imagination, so all the equations I&#8217;ve found online<br />
> wind up giving me some funky characters that are truly Greek to me<br />
> (literally). Ssomething like &#8220;sum the list, take the average, and&#8230;&#8221;<br />
> as an explanation would be brilliant.<br />
> <br />
> Thanks in advance.<br />
> <br />
> J. _______________________________________________ maxmsp mailing<br />
> </p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/centroid/#post-101588</guid>
					<title><![CDATA[Re: centroid?]]></title>
					<link>http://cycling74.com/forums/topic/centroid/#post-101588</link>
					<pubDate>Wed, 11 Apr 2007 15:27:54 +0000</pubDate>
					<dc:creator>jbm</dc:creator>

					<description>
						<![CDATA[
						<p>You rock.</p>
<p>That sounds about right to me&#8230; I know it&#8217;s supposed to give an interpolated index representing the &#8220;centre or gravity&#8221; of the list, so it would have to acknowledge the indices (and acknowledge zeros), that is to say, I think you&#8217;ve got the idea! I&#8217;ll give your code a shot a little later.</p>
<p>Thanks as always, Owen.</p>
<p>J.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/centroid/#post-101589</guid>
					<title><![CDATA[Re: centroid?]]></title>
					<link>http://cycling74.com/forums/topic/centroid/#post-101589</link>
					<pubDate>Wed, 11 Apr 2007 17:47:48 +0000</pubDate>
					<dc:creator>jbm</dc:creator>

					<description>
						<![CDATA[
						<p>Right, cool. So the only change is that it is indexing from 0 rather than 1. Other than that, you were on the money!</p>
<p>cheers,</p>
<p>J.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/centroid/#post-101590</guid>
					<title><![CDATA[Re: centroid?]]></title>
					<link>http://cycling74.com/forums/topic/centroid/#post-101590</link>
					<pubDate>Wed, 11 Apr 2007 17:50:44 +0000</pubDate>
					<dc:creator>_j</dc:creator>

					<description>
						<![CDATA[
						<p>ah, to start at 0 or 1, the age old battle.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/centroid/#post-101591</guid>
					<title><![CDATA[Re: centroid?]]></title>
					<link>http://cycling74.com/forums/topic/centroid/#post-101591</link>
					<pubDate>Wed, 11 Apr 2007 17:59:51 +0000</pubDate>
					<dc:creator>jbm</dc:creator>

					<description>
						<![CDATA[
						<p>heh&#8230; the Romans had it sussed, in that regard. Though they would have had a hell of a time getting fuzzy logic to work!</p>
<p>J.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/centroid/#post-101592</guid>
					<title><![CDATA[Re: centroid?]]></title>
					<link>http://cycling74.com/forums/topic/centroid/#post-101592</link>
					<pubDate>Wed, 11 Apr 2007 19:44:32 +0000</pubDate>
					<dc:creator>Jean-Francois Charles</dc:creator>

					<description>
						<![CDATA[
						<p>But in that case, it makes sense: if you use 0, you ignore the first value.</p>
<p>> ah, to start at 0 or 1, the age old battle.</p>
						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>

