Skip to content

Shapes tutorial missing NumPy constant definitions #15

@ghost

Description

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions