{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "366431a9",
   "metadata": {},
   "source": [
    "# 06-16 · Рисуем по координатам\n",
    "\n",
    "Практика к разделу [«Рисуем по координатам»](../../site/chapters/glava-06/06-16-risuem-po-koordinatam.html)."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "61e03f86",
   "metadata": {},
   "source": [
    "## Цель\n",
    "\n",
    "Спланировать фигуру в координатах, затем перевести план в код."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "823976ce",
   "metadata": {},
   "source": [
    "## Настройка (выполнить один раз)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "a03daa46",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T13:58:32.274737Z",
     "iopub.status.busy": "2026-08-16T13:58:32.274587Z",
     "iopub.status.idle": "2026-08-16T13:58:32.457971Z",
     "shell.execute_reply": "2026-08-16T13:58:32.457483Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Окно Turtle готово.\n"
     ]
    }
   ],
   "source": [
    "import turtle\n",
    "\n",
    "screen = turtle.Screen()\n",
    "artist = turtle.Turtle()\n",
    "artist.pensize(3)\n",
    "artist.pencolor(\"#5B24F9\")\n",
    "print(\"Окно Turtle готово.\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "86593b5e",
   "metadata": {},
   "source": [
    "## Рабочий пример\n",
    "\n",
    "Закрашенный треугольник по трём координатам."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "16e63d03",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T13:58:32.458939Z",
     "iopub.status.busy": "2026-08-16T13:58:32.458829Z",
     "iopub.status.idle": "2026-08-16T13:58:32.975148Z",
     "shell.execute_reply": "2026-08-16T13:58:32.974596Z"
    }
   },
   "outputs": [],
   "source": [
    "artist.reset()\n",
    "artist.fillcolor(\"#B9A0FC\")\n",
    "artist.penup()\n",
    "artist.goto(-60, -50)\n",
    "artist.pendown()\n",
    "artist.begin_fill()\n",
    "artist.goto(60, -50)\n",
    "artist.goto(0, 70)\n",
    "artist.goto(-60, -50)\n",
    "artist.end_fill()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1c3d53b0",
   "metadata": {},
   "source": [
    "## Задание ★ Базовая практика\n",
    "\n",
    "Нарисуйте закрашенный четырёхугольник по координатам (-80, -40), (80, -40), (60, 60), (-60, 60)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "d908f1e3",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T13:58:32.976956Z",
     "iopub.status.busy": "2026-08-16T13:58:32.976726Z",
     "iopub.status.idle": "2026-08-16T13:58:33.587692Z",
     "shell.execute_reply": "2026-08-16T13:58:33.587163Z"
    }
   },
   "outputs": [],
   "source": [
    "artist.reset()\n",
    "artist.fillcolor(\"#059669\")\n",
    "artist.penup()\n",
    "artist.goto(-80, -40)\n",
    "artist.pendown()\n",
    "artist.begin_fill()\n",
    "artist.goto(80, -40)\n",
    "artist.goto(60, 60)\n",
    "artist.goto(-60, 60)\n",
    "artist.goto(-80, -40)\n",
    "artist.end_fill()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1fa5bd75",
   "metadata": {},
   "source": [
    "## Завершение (выполнить один раз, в самом конце)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "5c717cb0",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T13:58:33.588653Z",
     "iopub.status.busy": "2026-08-16T13:58:33.588545Z",
     "iopub.status.idle": "2026-08-16T13:58:33.591563Z",
     "shell.execute_reply": "2026-08-16T13:58:33.591023Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Окно Turtle закрыто.\n"
     ]
    }
   ],
   "source": [
    "screen.bye()\n",
    "print(\"Окно Turtle закрыто.\")"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Cartesian Python 3.14",
   "language": "python",
   "name": "cartesian-python314"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.14.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
