<commit_before>from pygame.math import Vector2
import math
from matplotlib import pyplot as plt

class Car:
  def __init__(self):
    # dynamic stuff
    self.position = Vector2(0.0, 0.0)
    self.velocity = Vector2(0.0, 0.0)
    # motor commandos
    self.steer_angle = 0.0
    self.motor_force = 1.0
    # parameters
    self.mass = 1.0
    self.wheelbase = 1.0
    self.wheel_friction = (1e-3, 1e-1)
  def update(self, dt=1e-2):
    pass


if __name__ = "__main__":
  for t in range(100):
    car.update(dt=1e-2)
    plt.plot(car.position.x, car.position.y, "k.")
  plt.gca().set_aspect("equal", "datalim")
  plt.show()<commit_msg>correct update rules<commit_after>from pygame.math import Vector2
import math
from matplotlib import pyplot as plt

class Car:
  def __init__(self):
    # dynamic stuff
    self.position = Vector2(0.0, 0.0)
    self.velocity = Vector2(0.0, 0.0)
    # motor commandos
    self.steer_angle = 0.0
    self.motor_force = 1.0
    # parameters
    self.mass = 1.0
    self.wheelbase = 1.0
    self.wheel_friction = (1e-3, 1e-1)
  def update(self, dt=1e-2):
    total_force = vector2(0.0, 0.0)
    # update velocity
    self.velocity = self.velocity + total_force / self.mass * dt
    # update position
    self.position = self.position + self.velocity * dt


if __name__ = "__main__":
  for t in range(100):
    car.update(dt=1e-2)
    plt.plot(car.position.x, car.position.y, "k.")
  plt.gca().set_aspect("equal", "datalim")
  plt.show()
{'fraction_non_alphanumeric': 0.13437926330150068, 'fraction_numerical': 0.04433833560709413, 'mean_word_length': 2.912, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3963877', 'n_tokens_mistral': 587, 'n_tokens_neox': 562, 'n_words': 128}