Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

Commit

Permalink
adding example gif.
Browse files Browse the repository at this point in the history
  • Loading branch information
GaryBrownEEngr committed Nov 29, 2023
1 parent 937bca1 commit 443490c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,13 @@ Things to look into:
```bash
GOOS=windows go build ./examples/fallingturtles/
```

## Example

### Double Pendulum

```bash
go run github.com/GaryBrownEEngr/scratch/examples/DoublePendulum@latest
```

![Example Picture](https://github.com/GaryBrownEEngr/scratch/blob/main/examples/DoublePendulum/DoublePendulum.gif)
Binary file added examples/DoublePendulum/DoublePendulum.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion examples/DoublePendulum/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func simStartFunc(sim models.Scratch) {
// Loop forever
for {
// perform x steps per image update.
for i := 0; i < 5; i++ {
for i := 0; i < 1; i++ {
w1, w2, theta1, theta2 = step(w1, w2, theta1, theta2)
x1, y1, x2, y2 := GetPos(w1, w2, theta1, theta2, scaleUpBy)
mass1.Pos(x1, y1)
Expand Down

0 comments on commit 443490c

Please sign in to comment.