This is a draft of the splash screen for the upcoming 0.5-release.
Suggestions and submissions are welcome!
Year: 2010
jNetMap on GetDeb
Cool! jNetMap 0.3.3.5 is now on GetDeb.net
“GetDeb is an unofficial project with the mission to provide the latest open source and freeware applications for the current Ubuntu Linux release, in an easy to install manner.”
Thanks to Christoph Korn for packaging/publishing
- Install the getdeb package
- sudo apt-get update
- sudo apt-get install jnetmap
Average wind direction
Here’s a little PHP snippet for averaging wind directions.
Turns out there is a reason they teach you math in school 😉
//Expects: An array containing wind direction in degrees //Returns: Average wind direction function avgWind($directionArray) { $sinsum = 0; $cossum = 0; foreach ($directionArray as $value) { $sinsum += sin(deg2rad($value)); $cossum += cos(deg2rad($value)); } return ((rad2deg(atan2($sinsum, $cossum)) + 360) % 360); }
Some of you might have noticed that this only makes sense if you collect your samples multiple times per minute. This implementation also doesn’t take wind speed into consideration. If this is your intent, multiply the sin(..) and cos(..) in the loop with the wind speed at that time. And yes, averaging [0,180] will result in 90° although 270° would also be correct, hence my first remark.