Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Indeed, alongside all the other numerical calculations and symbolic manipulation...

Example question: what is the diameter of a sphere of tungsten - in inches, say - that weighs the same as a human (say, 150 lbs)?

Looking up the formula for the volume of a sphere gives: v = (4/3) pi (r^3), and googling the density of tungsten gives us 19.3 g/cm3.

Great! Now we already have inches, centimeters, pounds, grams, a fiddly ^3 to trip up our unit conversion from cubic centimeters to cubic inches (or is it vice versa?), some rearranging of an equation to extract the 'r'...

Luckily with qalculate, we can just smoosh it all together without thinking. We can substitute 'd/2' for "r", followed by 'x' for 'd' to tell qalculate that that's the quantity we want to figure out, and put it in inches while we're at it:

v = (4/3) pi ((x/2 inches)^3)

We're not after the volume but rather the mass, which is the volume times the density, and should equal 150lbs:

150 lb = (19.3 g/cm3) (4/3) pi ((x/2 inches)^3)

Hit enter and:

x ≈ 7.434184004

Amazing. A 7.4 inch cannonball of tungsten weighs as much as an adult human. Note that the result is only dimensionless because we balanced the equation - if we'd messed up any part of this formula, we'd have probably got our answer back in some perverse unit instead.

Oh and we didn't actually need to look up the formula for the volume of a sphere:

150 lb = (19.3 g/cm3) sphere(x/2 inches)



I'm confused why the result is dimensionless when you asked for inches.


Its returning the text that needs to be inserted in place of x to make the equality true. Since the parentheses already contain the inches they are not redundantly attached to the x. If you remove the inches from the query you get the result in mm, you would use 150 lb = (19.3 g/cm3) (4/3) pi ((x/2)^3) -> inches to get the answer in inches.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: