This is a draft of the splash screen for the upcoming 0.5-release.
|
|||
Cool! jNetMap 0.3.3.5 is now on GetDeb.net
|
|||
//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. |
|||
Good news everyone! I was able to take over the project-page on sourceforge, so you can now access the latest builds of the bottom-up rewrites of jNetMap! Just head over to sourceforge.net/projects/jnetmap. There's also a nice project page, which is somewhat more suitable for distributing software than a blog. |
|||
JSuggestField s = new JSuggestField(this, suggestData); See the javadoc for details. Archive contains the JSuggestField-class and an example. Tested with jre 1.6
|
|||||



.png)
Here's a little PHP snippet for averaging wind directions.




