public class BearingMean
extends java.lang.Object
This is tricky, since the mean of 359 and 1 is 0, so the first thing to do is to try to find the centre of where most angles are, then we calculate all angles relative to that reference point, and finally, get the mean.
Strategy is to calculate a unit vector for each bearing, then take the mean vector. If all bearings cancel each other out, then the bearing returned will be NaN.
function has been put into a class like this so that it can go further and calculate the standard deviation as well should it feel like it.
Constructor and Description |
---|
BearingMean(double[] bearings) |
Modifier and Type | Method and Description |
---|---|
double |
getBearingMean() |
double |
getBearingR()
Magnitude of resultant vector r.
|
double |
getBearingSTD()
Get the standard deviation about the mean.
|
double |
getBearingSTD2()
The standard deviation of as
defined by Zar (1999) sqrt(2*(1-R))
|
public double getBearingMean()
public double getBearingSTD()
public double getBearingR()
public double getBearingSTD2()