phetsims/collision-lab

Review of derivation documents.

Closed this issue · 3 comments

When working in the CollisionEngine, I found some lack of documentation on where some of the calculations came from, especially when finding the time of contact of ball collisions. I found it especially confusing that the model needed to know dt for both of these calculations.

Since then, I've derived these calculations without the need for dt and significantly cleaned up our CollisionEngine. The derivations were beyond the scope to document in the code, so I drafted up some documents in https://github.com/phetsims/collision-lab/tree/master/doc/images and referenced them.

@veillette if you have time, these documents should probably be reviewed.

@brandonLi8, overall, the documents look good. In fact, it is better than good. this would help a lot.

Unrelated to this issue, but it also helped that you cleaned the model and got rid of the previous time and current time references.

One suggestion would be to rewrite the formula such that C is labelled as a time (duck typing for math). Also, i think it would be worth to be more explicit about the sign of C, and how its relationship with the simulation going "forward" and "backward" in time, as well as how it is related to the current time.

Also you can consider rewriting the document in a more editable friendly format (rather than PDF).
There are different approaches to using markdown (https://gist.github.com/a-rodin/fef3f543412d6e1ec5b6cf55bf197d7b) as well as latex.

The model now uses new algorithms for the new priori collision engine. I've went ahead and converted those to markdown. Closing.