exports = module.exports = AtmosphericObservation;

/**
 * Create a new instance of AtmosphericObservation with the given parameters.
 * @param {Number} altitude    Geometric altitude above sea level in meters
 * @param {Number} pressure    Pressure in pascals
 * @param {Number} temperature Temperature in kelvins
 * @param {Number} windU       Easterly component of wind velocity in meters per second
 * @param {Number} windV       Northerly component of wind velocity in meters per second
 */

function AtmosphericObservation(altitude, pressure, temperature, windU, windV) {
	this.altitude = altitude;
	this.pressure = pressure;
	this.temperature = temperature;
	this.windU = windU;
	this.windV = windV;
}

AtmosphericObservation.prototype.getWindDirection = function() {
	return Math.atan2(this.windU, -this.windV);
};

AtmosphericObservation.prototype.getWindSpeed = function() {
	return Math.sqrt(Math.pow(this.windU, 2) + Math.pow(this.windV, 2));
};
@@ -707,121 +707,615 @@
 %0A%7D%0A%0A
-AtmosphericObservation.prototype.getWindDirection = function() %7B%0A%09return Math.atan2(this.windU, -this.windV);%0A%7D;%0A
+/**%0A * Compute the wind direction represented by this observation.%0A *%0A * The computed direction uses the meteorlogical standard of%0A * representing the direction the wind is from rather than the%0A * actual direction of the wind velocity vector.%0A *%0A * @return %7BNumber%7D Radians clockwise from north.%0A */%0AAtmosphericObservation.prototype.getWindDirection = function() %7B%0A%09// TODO Should the angle be the same format as compas bearings?%0A%09return Math.atan2(this.windU, -this.windV);%0A%7D;%0A%0A/**%0A * Compute the wind speed represented by this observation.%0A * %0A * @return %7BNumber%7D Total wind speed in meters per second%0A */
 %0AAtm

Document AtmosphericObservation