Skip to content

Commit 350492d

Browse files
Merge pull request #20 from ResearchCodingClub/triangle_bug_fix
Correct an error in the computation of the equilaterial triangle parameterisation example
2 parents b66ce20 + 3fe1f0b commit 350492d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

episodes/08-parametrization.Rmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def test_calculate_area():
6161
p12 = Point(2, 0)
6262
p13 = Point(1, 1.7320)
6363
t1 = Triangle(p11, p12, p13)
64-
assert t1.calculate_area() == 6
64+
assert t1.calculate_area() == 1.7320
6565

6666
# Right-angled triangle
6767
p21 = Point(0, 0)
@@ -100,7 +100,7 @@ import pytest
100100
@pytest.mark.parametrize(
101101
("p1x, p1y, p2x, p2y, p3x, p3y, expected"),
102102
[
103-
pytest.param(0, 0, 2, 0, 1, 1.7320, 6, id="Equilateral triangle"),
103+
pytest.param(0, 0, 2, 0, 1, 1.7320, 1.7320, id="Equilateral triangle"),
104104
pytest.param(0, 0, 3, 0, 0, 4, 6, id="Right-angled triangle"),
105105
pytest.param(0, 0, 4, 0, 2, 8, 16, id="Isosceles triangle"),
106106
pytest.param(0, 0, 3, 0, 1, 4, 6, id="Scalene triangle"),

0 commit comments

Comments
 (0)