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

Shapes tutorial missing NumPy constant definitions #15

Open
ghost opened this issue Mar 31, 2020 · 0 comments
Open

Shapes tutorial missing NumPy constant definitions #15

ghost opened this issue Mar 31, 2020 · 0 comments

Comments

@ghost
Copy link

ghost commented Mar 31, 2020

In the shapes tutorial, for the yellow lines, there are several places where constants are not defined as np.<constant>, even though they are inherited from NumPy. The code currently reads:

pointers = []
for i in range(8):
    pointers.append(Line(ORIGIN, np.array([cos(pi/180*360/8*i),sin(pi/180*360/8*i), 0]),color=YELLOW))

But needs to be fixed to:

pointers = []
    for i in range(8):
        pointers.append(Line(ORIGIN, np.array([np.cos(np.pi/180*360/8*i), np.sin(np.pi//180*360/8*i), 0]), color=YELLOW))

Where sin() and cos() have been fixed to np.sin() and np.cos(), and pi has been fixed to np.pi. Without it, the script doesn't compile properly (at least not for me).

Edit: I have posted a pull request. I can't link it to this issue because I don't have edit access, but I forked this repo and created a pull from a branch on my fork.

@ghost ghost mentioned this issue Mar 31, 2020
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

0 participants