Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- telemetry = []
- inp = []
- for _ in range(int(input())):
- t, at, an, w = map(float, input().split())
- telemetry.append({"t": int(t), "at": at, "an": an, "w": w})
- coord = {"x": 0, "y": 0} # начальное положение
- av = {"x": 0, "y": 1} # вектор направления движения
- alpha = 90
- current_speed = 0 # текущая скорость
- for data in telemetry:
- if data["at"]:
- # прямоленейное движение
- current_speed += data["at"] #*delta_second
- elif data["an"]:
- # движение по окружности
- radius = data["an"] / (data["w"]*math.pi/180)**2
- current_speed = abs(data["w"]*math.pi*radius/180)
- alpha -= data["w"]
- av["x"] = math.cos(math.radians(alpha))
- av["y"] = math.sin(math.radians(alpha))
- coord["x"] += av["x"]*current_speed
- coord["y"] += av["y"]*current_speed
- print(coord["x"], coord["y"])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement