Skip to content

Commit

Permalink
Add comment about "influence" function
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffPaine authored Dec 3, 2017
1 parent 5e01b8d commit 4a57638
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,9 @@ The second approach is more high-level, doesn't risk getting the order wrong and
```python
tmp_x = x + dx * t
tmp_y = y + dy * t
# NOTE: The "influence" function here is just an example function, what it does
# is not important. The important part is how to manage updating multiple
# variables at once.
tmp_dx = influence(m, x, y, dx, dy, partial='x')
tmp_dy = influence(m, x, y, dx, dy, partial='y')
x = tmp_x
Expand All @@ -445,6 +448,9 @@ dy = tmp_dy
### Better

```python
# NOTE: The "influence" function here is just an example function, what it does
# is not important. The important part is how to manage updating multiple
# variables at once.
x, y, dx, dy = (x + dx * t,
y + dy * t,
influence(m, x, y, dx, dy, partial='x'),
Expand Down

0 comments on commit 4a57638

Please sign in to comment.