// Moment Converter 

function MomentConverter(unit, value){
	this.uv = new Array(); 
	this.uv = {
		"Newton Meters" : 1, // ref unit
		"Kilogram Meters" : 0.102,
		"Kilogram Centimeters" : 10.2,
		"MilliNewton Meters" : 1000,
		"Gram Centimeters" : 10197,
		"Ounce Inches" : 141.6,
		"Pound Inches" : 8.851,
		"Pound Feet" : 0.738
	}
	this.unit = unit; // unit to convert from
	this.value = value; // value to convert
	this.ref = 1 / this.uv[this.unit] * this.value;
}

// returns value for singel unit
MomentConverter.prototype.cV = function(unitTo){
	return this.ref * this.uv[unitTo];
}
// returns values for all units
MomentConverter.prototype.cVs = function(){
	var msg = this.value + " " + this.unit + " => \n";
	for (var i in this.uv) {
		msg += Math.round(this.ref * this.uv[i] * 1000)/1000 + "  " + i + "\n";
	}  
	return msg;
}

// Copyright engineeringtoolbox.com
