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

Vector sum gets wrong result #3

Closed
Tbolp opened this issue May 27, 2017 · 1 comment
Closed

Vector sum gets wrong result #3

Tbolp opened this issue May 27, 2017 · 1 comment

Comments

@Tbolp
Copy link

Tbolp commented May 27, 2017

v1 = Vector(0, 0, 0)
v2 = Vector(1, 2, 3)
print(v1.sum(v2))
it should be (1, 2, 3), but now i get (1, 1, 1)

@barbaBus
Copy link

barbaBus commented Jun 15, 2017

I have worked out a fix for this issue and any other potential issues generated by the same bug.
In sum function, as well as in all the others functions, it is wrong to use "self.vecotr.index(x)" to identify the position of the vector component to use in the sum because if you have more identical values it returns always the first occurrence.

@allelos allelos closed this as completed Jul 31, 2017
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

No branches or pull requests

3 participants