Path: csiph.com!aioe.org!W4+pUJJ+LMQSnRdpBvjvmw.user.46.165.242.91.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.programming Subject: Re: Another little puzzle Date: Sat, 31 Dec 2022 17:04:47 +0100 Organization: Aioe.org NNTP Server Message-ID: References: <87tu1diu2s.fsf@bsb.me.uk> <864jtdtkt5.fsf@linuxsc.com> <87o7rlhtsv.fsf@bsb.me.uk> <878rioifnh.fsf@bsb.me.uk> <868rinskhk.fsf@linuxsc.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: gioia.aioe.org; logging-data="4924"; posting-host="W4+pUJJ+LMQSnRdpBvjvmw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org"; User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 X-Notice: Filtered by postfilter v. 0.9.2 Content-Language: en-US Xref: csiph.com comp.programming:16199 On 2022-12-31 15:42, Tim Rentsch wrote: > Ben Bacarisse writes: >> For the "vector average", we convert the t(i) to unit vectors u(i) and >> we calculate the mean if the u(i) to get a vector m. The "average", A, >> is just the direction of this vector -- another point on the unit >> circle. In this case we are minimising the sum of squares of the >> /chord/ lengths between A and the t(i). > > I think of this approach differently. I take the time values > t(i) as being unit masses on the unit circle, and calculate the > center of mass. As long as the center of mass is not the origin > we can project it from the origin to find a corresponding time > value on the unit circle (which in my case is done implicitly by > using atan2()). Center of mass of a set of ideal points (particles) and vector average are same: CoM = Sum Mi * Ri / Sum Mi i = 1..n i = 1..n Mi = masses, Ri = vectors. If all Mi are same you get CoM = Sum Ri / n i = 1..n >> This distinction between arc lengths and chord lengths helps to >> visualise where these averages differ, and why the conventional >> average may seem more intuitive. > > Interesting perspective. I wouldn't call them chord lengths > because I think of a chord as being between two points both on > the same circle, and the center of mass is never on the unit > circle (not counting the case when all the time values are the > same). Even so it's an interesting way to view the distinction. Arc length is proportional to angle: L = Rα, R is radius, α is angle in radians. Averaging arcs is equivalent to averaging angles. > Now that I think about it, finding the point that minimizes the > great circle distances squared would be at least computationally > unpleasant. See above, it is just angles to average. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de