Skip to content

Instantly share code, notes, and snippets.

@jordandobson
Forked from koenbok/qc-framer.js
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jordandobson/18b59c85d6c2ebd002ac to your computer and use it in GitHub Desktop.
Save jordandobson/18b59c85d6c2ebd002ac to your computer and use it in GitHub Desktop.
var QcValueConverter = {
tensionFromQcValue: function(qcValue) {
return (qcValue - 30.0) * 3.62 + 194.0;
},
qcValueFromTension: function(tension) {
return (tension - 194.0) / 3.62 + 30.0;
},
frictionFromQcValue: function(qcValue) {
return (qcValue - 8.0) * 3.0 + 25.0;
},
qcValueFromFriction: function(friction) {
return (friction - 25.0) / 3.0 + 8.0;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment