Sha256: 286cc662deada043947b11222af1546112c8ac6ad977ee780ba89561909778ca

Contents?: true

Size: 466 Bytes

Versions: 1

Compression:

Stored size: 466 Bytes

Contents

require "z15014am_calcUtils/version"
include Math

module Z15014amCalcUtils
	def self.calcBMI(height,weight)
		puts "Your BMI is " + (weight/(height*height)).to_s
	end
	
	def self.calcDistance(lat1,lon1,lat2,lon2)
		r = 6378.137; 

		lat1 = lat1 * PI / 180;
		lon1 = lon2 * PI / 180;
		
		lat2 = lat2 * PI / 180;
		lon2 = lon2 * PI / 180;

		puts "The Distance is "+(r * acos(sin(lat1) * sin(lat2) + cos(lat1) * cos(lat2) * cos(lon2 - lon1))).to_s+" km";
	end	 
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
z15014am_calcUtils-0.1.0 lib/z15014am_calcUtils.rb