Skip to content

Commit 874662a

Browse files
leiosjiegillet
authored andcommitted
smallscale changes to javascript tree traversal, jarvis julia, and euler text. (#492)
1 parent e8af991 commit 874662a

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

contents/forward_euler_method/forward_euler_method.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ That said, variations of this method *are* certainly used (for example Crank-Nic
9595

9696
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.
9797
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.
98-
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.
98+
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$$.
99+
Note that in this case, the velocity is directly given by the ODE and the acceleration is not part of the model.
99100

100101
{% method %}
101102
{% sample lang="jl" %}

contents/jarvis_march/code/julia/jarvis.jl

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ function jarvis_march(points::Vector{Pos})
2222

2323
# Find cross product between points
2424
curr_product = jarvis_cross(Pos(0,0), hull[1], curr_point)
25-
#while (curr_point != hull[1])
26-
while (length(hull) < 4)
25+
while (curr_point != hull[1])
2726
for point in points
2827
product = 0.0
2928
if (i == 1)

contents/tree_traversal/tree_traversal.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ Trees are naturally recursive data structures, and because of this, we cannot ac
1414
{% sample lang="java" %}
1515
[import:110-126, lang:"java"](code/java/Tree.java)
1616
{% sample lang="js" %}
17-
This has not been implemented in your chosen language, so here is the Julia code
18-
[import:3-7, lang:"julia"](code/julia/Tree.jl)
17+
[import:1-10, lang:"javascript"](code/javascript/tree.js)
18+
As a note, a `node` struct is not necessary in javascript, so this is an example of how a tree might be constructed.
1919
{% sample lang="py" %}
2020
[import:1-4, lang:"python"](code/python/Tree_example.py)
2121
{% sample lang="scratch" %}

0 commit comments

Comments
 (0)