Live data from Hacker News

Draw an iceberg and see how it would float in water

joshdata.me

61–70 of 179 posts

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

#61
post #3

What a cool idea. Drawing a star is fun. If you draw something in the basic shape of a Y, with two thick arms and one thin arm, my instinct tells me that the two thick arms should end up on the top, with the thin one pointing down into the water. Is that accurate? There's not much jostling in the demo; any of the arms might end up pointing down. EDIT: You can also pretty easily get something to float in either an M o…

Yes this is pretty cool! It’d be awesome if you could link to the drawings. Though I bet descriptions of most of the images would rhyme with “ice rocks”.

I thought I was the only one who drew Spock…

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

#63
The twitter thread links to this article about stable equilibria explaining some of the physics

https://physicstoday.scitation.org/doi/10.1063/PT.3.4373

which in turn links to this paper, E. N. Gilbert's How Things Float, which gives much more detailed mathematical explanation

PDF: http://111.90.145.71/scimag/get.php?doi=10.2307/2325023&key=...

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

#65
post #53

Earlier quoted context omitted.

For many shapes, there are multiple points of stability! If you drew a cross, you'd find that it could stabilize on any two corners. Stability of a floating object is determined by a "righting arm": A torque produced by the horizontal offset between the object's center of mass, and the center of buoyancy (The center of mass of the portion underwater). Sometimes, that torque produces "positive stability" -- When the o…

When it comes to stability there is a crucial handicap between ships and icebergs. The former have non-uniform mass, so it is possible for a ship's center of mass to be below its center of buoyancy. That's why ships have ballast - it lowers the center of mass relative to the center of buoyancy. An iceberg is uniform, so its center of buoyancy is always below its center of mass. This makes its stability trickier, as i…

Good point -- The way I described it really applies to _any_ object floating in water. I don't have much experience with ship design, but on small boat design you can rely mostly on the geometry of the boat to produce a sufficient righting moment even with a very high center of mass.

Some off-shore speedboats have really incredible self-righting because they've been designed to always have positive stability at all angles. One of my favorite videos of this in action: https://www.youtube.com/watch?v=Y2i1fOJ-itw

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

#66
post #52

Earlier quoted context omitted.

And yet, what is harder to attain and yet more necessary than the knowledge and impetus to implement such a project? It may not be necessary, but the specific tools are't the part that are necessary.

It’s interesting that proponents of a simpler web argue in favor of Jquery for a use case where jquery is in fact very easy to live without. One would almost think dogmatic thinking is involved.

[deleted]

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

#67
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.

The code must somehow compute bouyancy in a way that reflects the object's arbitrarily complex shape. It's likely carving the object up into some number of smaller primitive objects whose equations for bouyancy are known. In order to make the whole object move as one rigid body, though, it's probably computing force vectors for each primitive, and then summing them together based on the overall object's center of mass and moment of inertia.

My guess is that the object's mass and inertia is calculated in a way that is sensitive to the handedness of the drawing. The code probably takes the absolute value of the result so that right-handed and left-handed drawings both end up with positive mass. When you draw lobes though, the signedness alternates and cancels out, leading to less mass. With even numbers of lobes of near equal size, you end up with near zero mass.

The forces being computed on each primitive are probably representative of that primitive's true mass. Subsequently applying those same forces to a rigid body with significantly less mass therefore results in extreme acceleration. f=ma, f/m=a. f/0=explode.

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

#68
post #52

Earlier quoted context omitted.

And yet, what is harder to attain and yet more necessary than the knowledge and impetus to implement such a project? It may not be necessary, but the specific tools are't the part that are necessary.

It’s interesting that proponents of a simpler web argue in favor of Jquery for a use case where jquery is in fact very easy to live without. One would almost think dogmatic thinking is involved.

> It’s interesting that proponents of a simpler web argue in favor of Jquery for a use case where jquery is in fact very easy to live without. One would almost think dogmatic thinking is involved.

But to do without it, you will end up rewriting the shortcuts and utility functions that JQuery provides, effectively recreating a project-specific, less-tested and less-supported JQuery.

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

#70

Sidenote: Good demonstration that even in 2021 jQuery has its place as the right tool for the job: quickly hacking together a small project.

junior devs say dumb things about jQuery because they need to build experience and clout in complicated bloatware

fortunately the crypto space is paying well enough these days and all you need is a wallet connect button, without a backend, so devs don't have to deal with this particular elitist bullshit to get hired by someone else anymore

its actually questionable whether you need a frontend to make money right now. I've seen plenty of "dutch auctions" with just the liquidity pools: just gotta deploy a smart contract and give instructions on how to form transactions to it.

Post reply on HN