-
-
Notifications
You must be signed in to change notification settings - Fork 360
Verlet implementation in Common Lisp #608
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Verlet implementation in Common Lisp #608
Conversation
Fixed some things and I think it looks pretty good now. Open for review! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no issues with the algorithm, it's idiomatic as far as I can tell. Just a few nits.
When looking back at the function descriptions now, I don't like them that much. They are awkwardly worded. If somebody knows a better wording while keeping it on one line, please let me know. Otherwise, all of the problems noticed by @berquist are fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am happy with the code but will wait for your comments on the docstring wording.
;;;; Verlet integration implementation in Common Lisp | ||
|
||
(defun verlet (pos acc dt) | ||
"Finds the time it takes for an object to hit the ground using Verlet integration." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with you, and think the problem is "hits the ground". That's an application of the method, sure, but we are really just integrating Newton's equation of motion from position = pos (greater than 0)
to position = 0
. Maybe this helps with the reword?
@Trashtalk217 poke. |
Who dares disturb me in my slumber. I've tried something other doc-strings. But I'm not sure this is an improvement. |
If we look at a "real" CL program (https://github.com/rigetti/quilc/blob/master/src/analysis/fusion.lisp), docstrings can be as long as you want on a single line. Elisp often has paragraphs (https://github.com/greghendershott/racket-mode/blob/master/racket-common.el), usually with line breaks at reasonable places (logical lines or 50-100 characters long). This is to say that if you feel constrained by the docstring length, they can be made longer. I'm going to merge this rather than have it sit around, and if you want to change the docstrings, by all means submit another PR. |
Not completely happy with this one, it's still a bit of a work in progress.