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

Possible mistake in the assertions about the angles of the Triangle class #91

Open
esemsc-gh124 opened this issue Sep 26, 2024 · 4 comments
Labels
exercise-clarification Exercise text is confusing

Comments

@esemsc-gh124
Copy link

Dear Dr Beg,

Some assertions made about the angles() method of the Triangle class in lecture 5 are possibly wrong, because they don't agree with the specification for the method.

add a method to the Triangle class called angles(). It should return a tuple of three floats, each representing the interior angle in radians of the vertices of the triangle, ordered so that the first angle is at the first vertex of the triangle, and so on.

However, in the assertions, it appears that the angles of the first and second vertices are accidentally swapped.
sc1

I appreciate your time into this issue in advance.

Yours truly,
esemsc-df329480 (Guanyuming He)

@esemsc-gh124
Copy link
Author

Dear Dr Beg,

It just occurred to me that perhaps you wanted each angle to correspond to an edge, instead of a vertex. Nevertheless, there's some inconsistency with the specification.

@marijanbeg
Copy link
Contributor

Hi @esemsc-df329480, thank you for letting us know. I agree with you that the problem description is a bit vague and can be understood differently. Would you like to suggest to us how you would formulate that question and we can consider including it for the next cohort?

@esemsc-gh124
Copy link
Author

Dear Dr Beg,

I think your description is good and clear. According to it, the first angle, angles()[0], should be the one at the first vertex, $(0,0)$; and it should be $\pi/2$. The problem is that $\pi/2$ is asserted to be angles()[1] instead.

With that said, however, since each vertex is assigned a name in __init__ ($a$, $b$, and $c$), I can think of a way to make the statement 100% accurate, using mathematical language. For example, we could rephrase the specification of angles() to:

The angles() method should return the tuple $(\angle cab, \angle abc, \angle bca)$, in radians.

Cheers. :)

@marijanbeg
Copy link
Contributor

That's a great suggestion. Alternatively, we can adjust the tests so it does not matter what the order of the angles in the tuple is.

Thank you! I will leave this issue open to remind us to update the materials.

@marijanbeg marijanbeg added the exercise-clarification Exercise text is confusing label Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exercise-clarification Exercise text is confusing
Projects
None yet
Development

No branches or pull requests

2 participants