Live data from Hacker News

Draw an iceberg and see how it would float in water

joshdata.me

111–120 of 179 posts

Re: Draw an iceberg and see how it would float in water

#112
post #30

Hmm... what determines whether an iceberg would flip over? I tried drawing bowl-shaped icebergs, one upright and one upside-down. Both stayed in their general orientation without flipping over.

I suspect, based on nothing in particular, that one of those orientations is more stable than the other, but the demo doesn't provide enough turbulence to get from one to the other.

I agree. Finding the absolute minimum when there are many local minimums can be very difficult.

I like https://en.wikipedia.org/wiki/Simulated_annealing it does not guaranty to find the absolute minimum, it has a few parameters that are difficult to tweak, but I got good results.

Re: Draw an iceberg and see how it would float in water

#113

It's amazing that this kind of simulation can be done so accurately with javascript in a web browser. I have no idea how it was implemented but the computational load must be nontrivial.

I haven't looked at the code but it's likely some out-of-the-box physics engine, many of them available in JS. They often have to employ many more complex physics features. Buoyancy is just one of them. Computationally I'm sure it's complex, but it's made to run at game tickrates, less than the max budget of 16ms at a time.

Re: Draw an iceberg and see how it would float in water

#114
So without any further knowledge about how icebergs should orient and how scientists draw them:

Icebergs in 3D will generally have different mass distributions than the corresponding 2D projections that we are drawing here. For example, there will generally be higher "2D mass density" in the center.

Consequently, it is possible that the scientists "drawing icebergs wrong" are actually right and it just looks/"behaves" wrong in 2D. And even if they're doing it wrong, it's also possible to learn the wrong lessons regarding floating stability from this 2D playground.

Re: Draw an iceberg and see how it would float in water

#117
post #71
post #9

I get interesting results if I draw a figure 8 (or a figure ∞). I wonder if it's treating one of the lobes as having negative density.

I spent... longer than I should have trying to take advantage of this bug to recreate a stable version of the stereotypical tall iceberg that the original tweet was complaining about. https://imgur.com/a/WG6D0RJ

[deleted]

Re: Draw an iceberg and see how it would float in water

#120
post #26
post #9

I get interesting results if I draw a figure 8 (or a figure ∞). I wonder if it's treating one of the lobes as having negative density.

Figure of 8 icebergs fly off, then sink completely and finally float. Fun stuff. Is the source available? And some of them completely disappear!

yeah!!
Post reply on HN