The new NodeBox forum is live! Everything from support.nodebox.net moved here: sign in with the same email to pick up your old posts. Something not working? Write to forum-support@nodebox.net.

Show your WorkFrom the old forum

Pi walking

No replies yet

  1. This visualisation of pi assigns a color to each digit and an angle. Each time a digit is encountered a rect of the color is created and the origin moves by the relevant angle a distance the height of the rect. This means we are seeing pi in a directional state.

    The angle is calculated for each digit using the following python function:

    def x_points(data, index):
    points_dict = {0 : (0, -10),
    1 : (5.88, -8.09),
    2 : (9.51, -3.09),
    3 : (9.51, 3.09),
    4 : (5.88, 9.09),
    5 : (0, 10),
    6 : (-5.88, 8.09),
    7 : (-9.51, 3.090),
    8 : (-9.511, -3.09),
    9 : (-5.88, -8.09)
    }
    x_points = [0]
    for num in data[:-1]:
    x_points.append(x_points[-1] + points_dict[num][index])
    return x_points

    From the origin (0, 0) the x,y, coordinates are summed according to the item returned and this is what gives the visual its shape.

    Comments very welcome....

    Copy link

Know something that helps?

Sign in with your email address to reply. No password needed.

Sign in to reply