Closed whydoubt closed 1 month ago
A step further could be to pass velocity instead of center2... cutting out the intermediary. I haven't yet checked if that would complicate anything further down in the text though. I could put together a PR to this effect if the idea seems good.
If you only want to consider the change in position, without the hard implication that velocity is constant, displacement
could be another alternative for center_vec
.
As we know, naming variables is one of the hardest things...
In listing 2.3,
center_vec
is used to indicate the change in position over an interval of time. I don't feel the name conveys that well. Also, there is a well-established name for that concept: velocity. So I would proposevelocity
as a replacement. Note that this would also need to be changed in listings 2.10 and 2.11.Also in listing 2.11... Some underscores appeared where they weren't before:
center_vec = _center2 - _center1;
Looks like it may have been a leftover from an earlier revision of the book.