def draw_history(self, origin, scale, c=color(255, 0, 0)):
     pushMatrix()
     translate(*origin)
     stroke(c)
     for past_theta1, _, past_theta2, _ in self.simulation.history:
         polar1 = self.history_origin1 + [0, past_theta1]
         polar2 = self.history_origin2 + [0, past_theta2]
         x1, y1 = scale * polar2rect(polar1, flip_y = True)
         x2, y2 = scale * polar2rect(polar2, flip_y = True)
         point(x1, y1)
         point(x1 + x2, y1 + y2)
     popMatrix()
 def draw_history(self, origin, scale, c=color(255, 0, 0)):
     pushMatrix()
     translate(*origin)
     stroke(c)
     for past_theta, _ in self.simulation.history:
         polar = self.history_origin + [0, past_theta]
         point(*(scale * polar2rect(polar, flip_y = True)))
     popMatrix()
示例#3
0
 def draw_history(self, origin, scale, c=color(255, 0, 0)):
     pushMatrix()
     translate(*origin)
     stroke(c)
     for past_theta, _ in self.simulation.history:
         polar = self.history_origin + [0, past_theta]
         point(*(scale * polar2rect(polar, flip_y=True)))
     popMatrix()
 def draw(self, origin, scale, colors):
     bob_theta1, _, bob_theta2, _ = self.state
     bob_delta_polar1 = Vector(0, bob_theta1)
     bob_delta_polar2 = Vector(0, bob_theta2)
     
     pushMatrix()
     translate(*origin)
     stroke(colors[0])
     x1, y1 = scale * polar2rect(bob_delta_polar1 + self.bob_pos_rest1, flip_y = True)
     line(0, 0, x1, y1)
     circle(x1, y1, self.bob_size1)
     translate(x1, y1)
     
     stroke(colors[1])
     x2, y2 = scale * polar2rect(bob_delta_polar2 + self.bob_pos_rest2, flip_y = True)
     line(0, 0, x2, y2)
     circle(x2, y2, self.bob_size2)
     popMatrix()
 def draw(self, origin, scale, colors):
     bob_theta, _ = self.state
     bob_delta_polar = Vector(0, bob_theta)
     
     pushMatrix()
     translate(*origin)
     stroke(colors[0])
     x, y = scale * polar2rect(bob_delta_polar + self.bob_pos_rest, flip_y = True)
     
     line(0, 0, x, y)
     circle(x, y, self.bob_size)
     popMatrix()
示例#6
0
    def draw(self, origin, scale, colors):
        bob_theta, _ = self.state
        bob_delta_polar = Vector(0, bob_theta)

        pushMatrix()
        translate(*origin)
        stroke(colors[0])
        x, y = scale * polar2rect(bob_delta_polar + self.bob_pos_rest,
                                  flip_y=True)

        line(0, 0, x, y)
        circle(x, y, self.bob_size)
        popMatrix()