![]() It's quite unreadable, because I had to golf it down a lot: neat is that Mathematica immediately displays a miniature plot of what the solutions roughly look like: A derivation can be found in this PDF, although it's a fairly straight-forward exercise if you're familiar with Lagrangian mechanics. The following 143-character snippet solves the Lagrangian equations of motion for such a system (in terms of the pendulums' angles and angular momenta). I've also used unit gravity to shorten the equation. Each rod has unit length and each of the two pendulum weights has unit mass. I wanted to show a non-trivial example of that.Ĭonsider a double pendulum on a rod (i.e. I mentioned earlier that you can also equations numerically, and that you can also solve differential equations. I've been waiting for this for a while (and been golfing it for about as long, so I don't have to wait even longer). For some real gems, check out snippets 81, 64, 44, 23, 19, 12 and 8. See the revision history for a complete list of snippets up to 41. I've started to remove less interesting snippets, and I will start skipping snippets now. You might want to read this bottom-to-top since that's the order it was written in, and some explanations will refer to previous snippets or assume explanations from further down. Current answers, sorted alphabetically by language name There is a Stack Snippet for compressing posts, which should mitigate the effect of the 30,000 character limit.Īnswers that predate these guidelines should be edited. This is a community wiki, so feel free to add snippets to any answer, even if you haven't created it yourself. Whenever possible, there should be only one answer per programming language. Since this is not a contest, all programming languages are welcome, whenever they were created.Īnswers that contain more than a handful of code snippets should use a Stack Snippet to collapse everything except the factoid and one of the snippets. In fact, snippets that are too related may be redundant. How this worksĪll answers should include the name of the programming language at the top of the post, prefixed by a #.Īnswers may contain one (and only one) factoid, i.e., a couple of sentences without code that describe the language.Īside from the factoid, answers should consist of snippets of code, which can (but don't have to be) programs or functions. This is neither a challenge nor a competition, but a collaboration effort to showcase as many programming languages as possible as well as possible. This thread is dedicated to showing off interesting, useful, obscure, and/or unique features your favorite programming languages have to offer. If you know this thread from before, please make sure you familiarize yourself with the changes. This is no longer a popularity-contest, nor are snippet lengths limited by the vote tally. Please do not create additional showcase questions. Please do not use this question as evidence that you can ask similar questions here. This thread is open and unlocked only because the community decided to make an exception. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |