Skip to content

Conversation

@TRManderson
Copy link
Contributor

As per emails between Jon/Peter this morning

@sapi
Copy link
Contributor

sapi commented Apr 28, 2015

You'll need to update the DESCRIPTION class attribute on those tests as well.

This pull request would also require changing the tutorial task (in description.html), as it breaks the stated invariant that the first vertex be at the right angle.

@TRManderson
Copy link
Contributor Author

This PR actually fixes the tests to match description.html as previously the first vertex wasn't the right angle.

@sapi
Copy link
Contributor

sapi commented Apr 28, 2015

Oh, whoops...

On 28 April 2015 at 11:21, Tom Manderson [email protected] wrote:

This PR actually fixes the tests to match description.html as previously
the first vertex wasn't the right angle.


Reply to this email directly or view it on GitHub
#161 (comment).

@jgat
Copy link
Contributor

jgat commented Apr 28, 2015

Suggestion (possibly too mean for what already looks like a challenging problem): tweak the alternate test for 'area' so that the vertex list is given clockwise instead of anticlockwise. e.g.

    def test_alternate(self):
        def _get_results():
            t = RightAngledTriangle([(0, 5), (12, 5), (0, 0)])

This would catch students who don't take the absolute value of the distances.

(Edit: clarified which test to tweak)

@jgat
Copy link
Contributor

jgat commented Apr 28, 2015

Actually, now that I've thought about it for another few seconds, the right-angled-triangle area question actually requires some non-trivial geometry if the right angle is not aligned with the x- and y- axes.

[I had an example, but it was wrong, so I'm editing it out. You get the idea.]

@TRManderson
Copy link
Contributor Author

Yeah, euclidean distance between each point and the right angle. Not particularly simple.

@pjritee
Copy link
Contributor

pjritee commented Apr 28, 2015

Hi jgat,
I did point this out in an email about this issue (same goes for the rectangles) - dealing with sin/cos is asking way too much - we really want them to "line up with the axises"

@jgat
Copy link
Contributor

jgat commented Apr 28, 2015

I suggest tweaking the problem description (though you might have to deal with students who've already finished the task complaining that it gets made easier after they finish it).

Suggested new version of the task:

  • RightAngledTriangle's constructor takes two parameters, which are the two shorter side-lengths of the triangle. e.g. RightAngledTriangle(3, 4).area() == 5
  • Update the problem description so that students are guaranteed that shapes will always have one vertex at the origin, with two edges along the positive x and positive y axes (and hence, the right-angle of a RightAngledTriangle will always be at the origin).

@pjritee
Copy link
Contributor

pjritee commented Apr 28, 2015

I think this is the way to go - the question wasn't supposed to be about geometry after all

@sapi
Copy link
Contributor

sapi commented Apr 28, 2015

Agreed. It wasn't meant to be difficult.

If this looks like too much of a change for students who've already done
it, we could just add the additional constraints in the description and
keep the current input spec. (I do prefer jgat's suggestion though.)

On 28 April 2015 at 14:04, Peter Robinson [email protected] wrote:

I think this is the way to go - the question wasn't supposed to be about
geometry after all


Reply to this email directly or view it on GitHub
#161 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants