Skip to content

Instantly share code, notes, and snippets.

@mattkruskamp
Created February 23, 2011 23:47
Show Gist options
  • Save mattkruskamp/841454 to your computer and use it in GitHub Desktop.
Save mattkruskamp/841454 to your computer and use it in GitHub Desktop.
Simple Script for Dive Calculation
// Namespace to DevelopLive
DevelopLive = window.DevelopLive || {};
// Define Dive
DevelopLive.Dive = window.DevelopLive.Dive || {};
(function () {
$self = DevelopLive.Dive;
$self.calcSac = function(psiIn, psiOut, time,
depth, tankVolume, tankWorkingPsi) {
// calculate DAC
var dac = (psiIn - psiOut) / time,
// calculate SAC
sac = dac / ((depth / 33) + 1),
// calculate RMV
rmv = sac * tankVolume / tankWorkingPsi;
// return
return rmv;
}
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment