Skip to content
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

smallscale changes to javascript tree traversal, jarvis julia, and euler text #492

Merged
merged 1 commit into from
Oct 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion contents/forward_euler_method/forward_euler_method.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ That said, variations of this method *are* certainly used (for example Crank-Nic

Like in the case of [Verlet Integration](../verlet_integration/verlet_integration.md), the easiest way to test to see if this method works is to test it against a simple test-case.
Here, the most obvious test-case would be dropping a ball from 5 meters, which is my favorite example, but proved itself to be slightly less enlightening than I would have thought.
So, this time, let's remove ourselves from any physics and instead solve the following ODE: $$y' = 5y$$. Note that in this case, the velocity is directly given by the ODE and the acceleration is not part of the model.
So, this time, let's remove ourselves from any physics and instead solve the following ODE: $$y(t)' = -3t$$ with the initial condition that $$y(0) = 1$$.
Note that in this case, the velocity is directly given by the ODE and the acceleration is not part of the model.

{% method %}
{% sample lang="jl" %}
Expand Down
3 changes: 1 addition & 2 deletions contents/jarvis_march/code/julia/jarvis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ function jarvis_march(points::Vector{Pos})

# Find cross product between points
curr_product = jarvis_cross(Pos(0,0), hull[1], curr_point)
#while (curr_point != hull[1])
while (length(hull) < 4)
while (curr_point != hull[1])
for point in points
product = 0.0
if (i == 1)
Expand Down
4 changes: 2 additions & 2 deletions contents/tree_traversal/tree_traversal.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Trees are naturally recursive data structures, and because of this, we cannot ac
{% sample lang="java" %}
[import:110-126, lang:"java"](code/java/Tree.java)
{% sample lang="js" %}
This has not been implemented in your chosen language, so here is the Julia code
[import:3-7, lang:"julia"](code/julia/Tree.jl)
[import:1-10, lang:"javascript"](code/javascript/tree.js)
As a note, a `node` struct is not necessary in javascript, so this is an example of how a tree might be constructed.
{% sample lang="py" %}
[import:1-4, lang:"python"](code/python/Tree_example.py)
{% sample lang="scratch" %}
Expand Down