# ======================================================================
# 06회차 | 06 실습 - 8자를 함수로   [같이 코딩]
# ----------------------------------------------------------------------
# 왼쪽 원과 오른쪽 원은 y 의 부호만 다르다.
#   왼쪽 원  : curve( 60,  60, 0, 0,  120, 0, 30) -> curve(-60, -60, 0, 0, -120, 0, 30)
#   오른쪽 원: curve( 60, -60, 0, 0, -120, 0, 30) -> curve(-60,  60, 0, 0,  120, 0, 30)
# 그래서 side 라는 매개변수(1 또는 -1)를 y 자리에 곱하면 함수 하나로 둘 다 된다.
#
# 정답 : 01 미션 - 8자 비행 완성.py
# ======================================================================

from tello import start

tello_id = "TELLO-58C5B7"      # 내 드론 이름으로 바꾸기


def circle(side):              # side: 1 = 왼쪽 원, -1 = 오른쪽 원
    curve(60, 60 * side, 0, 0, 120 * side, 0, 30)

    # [빈칸 1] 뒤 절반 : 위 줄처럼 y 자리에 side 를 곱해서


def run():
    takeoff()

    circle(1)                  # 왼쪽 원

    # [빈칸 2] 오른쪽 원


    land()


start(tello_id, run)
