To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.org.ca.rtltorontoOpen lugnet.org.ca.rtltoronto in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Organizations / Canada / rtlToronto / 14261
14260  |  14262
Subject: 
Re: OT: Math Help
Newsgroups: 
lugnet.org.ca.rtltoronto
Date: 
Fri, 5 Aug 2005 19:38:30 GMT
Viewed: 
513 times
  
On Fri, Aug 05, 2005 at 07:25:52PM +0000, Rob Antonishen wrote:
Using trig, for each value accumulate the sum of the sines and the sum
of the cosines. Then divide each of these sums by the number of
entries to get:
x = average cosine and y = average sine. Then use the arctan2 function
to get the average angle as: Angle = arctan2( x , y), except this
fails if x=0 and y=0, as would be the case when trying to average 90
and 270, sot here is no simple solution to that problem with trig...

So any smart people up to the challenge?

I think using vector math (as you do above) is the right way to go.  As
for the special cases, meh, deal with it :)

--
Dan Boger
dan@peeron.com



Message has 1 Reply:
  Re: OT: Math Help
 
(...) And if you stop and think about it for a second or two, you'll realize your special case really does deserve special consideration. The average is no wind at all, so the direction would be undefined. (19 years ago, 5-Aug-05, to lugnet.org.ca.rtltoronto)

Message is in Reply To:
  OT: Math Help
 
Figured I'd bounce this problem off the smart people in RTLTotonto...This was posted on an automation mailing list, with little resolution: I have a weather station which measures both the direction and speed of the wind and is connected to a PC to (...) (19 years ago, 5-Aug-05, to lugnet.org.ca.rtltoronto)

9 Messages in This Thread:




Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR