Skip to content

Instantly share code, notes, and snippets.

@PatheticMustan
Created October 12, 2023 14:35
Show Gist options
  • Save PatheticMustan/54ef410e9259f07cc9584c7bac7980ad to your computer and use it in GitHub Desktop.
Save PatheticMustan/54ef410e9259f07cc9584c7bac7980ad to your computer and use it in GitHub Desktop.
function PK(m, v) {
const round = n => Math.round(n*1000)/1000;
console.log(`P: ${round(m*v)} K: ${round(0.5*m*(v**2))}`);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment