Skip to content

Instantly share code, notes, and snippets.



Last active Nov 15, 2020
What would you like to do?
How much does your giant weigh?
(defun height-mass (start-height start-mass end-height build-ratio)
"How much does your giant weigh?
Calculate from START-HEIGHT, START-MASS, and END-HEIGHT multiplied by
BUILD-RATIO the END-MASS. BUILD-RATIO is a factor to express the difference
in build between different creatures. (The factor for a dwarf might be 2.25,
225% heavier than normal.)
Formula: end-mass = start-mass * (end-height / start-height)^3
(interactive "nStarting Height? \nnStarting Mass? \nnEnd Height? \nnBuild Ratio? ")
(let* ((start-height (* 1.0 start-height)) ; make measurements floats.
(start-mass (* 1.0 start-mass))
(end-height (* 1.0 end-height))
(ratio (expt (/ end-height start-height) 3))
(end-mass (* start-mass ratio)))
(message "Start Height: %g; Start Mass: %g; End Height: %g; Build Ratio: %g
Ratio: %g; End Mass: %g; * Build Ratio: %g"
start-height start-mass end-height build-ratio
ratio end-mass (* build-ratio end-mass))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment