Geometrylessonsgithub !exclusive! Now
```markdown # Lesson 1: Points, Lines, Rays, and Segments
## Exercises 1. Identify collinear sets from an image. 2. Name rays and segments given endpoints. 3. Construct a line through two points using code. </code></pre> <hr> <h3><strong>4. Sample Animation: <code>lessons/01_points_lines/animations/point_construction.py</code></strong></h3> <pre><code class="language-python">from manim import *
This complete content provides a ready-to-push GitHub repository that teaches geometry visually, interactively, and programmatically. </code></pre> geometrylessonsgithub
self.play(FadeIn(dot_a, label_a), FadeIn(dot_b, label_b)) self.wait() self.play(Create(line)) self.wait() self.play(Transform(line, ray)) self.wait() self.play(Transform(line, segment)) self.wait() </code></pre> <hr> <h3><strong>5. Sample Interactive Notebook: <code>lessons/01_points_lines/interactive.ipynb</code></strong> (JSON-like snippet)</h3> <pre><code class="language-json">{ "cells": [ { "cell_type": "markdown", "source": [ "# Interactive Geometry: Points & Lines" ] }, { "cell_type": "code", "source": [ "import matplotlib.pyplot as plt\n", "import ipywidgets as widgets\n", "from IPython.display import display\n", "\n", "def plot_points(x1, y1, x2, y2, draw_line):\n", " plt.figure(figsize=(5,5))\n", " plt.scatter([x1, x2], [y1, y2], color='red')\n", " if draw_line:\n", " plt.plot([x1, x2], [y1, y2], 'b-')\n", " plt.xlim(-5,5); plt.ylim(-5,5)\n", " plt.grid(True)\n", " plt.show()\n", "\n", "widgets.interact(plot_points,\n", " x1=(-5,5,0.5), y1=(-5,5,0.5),\n", " x2=(-5,5,0.5), y2=(-5,5,0.5),\n", " draw_line=False)" ] } ] } </code></pre> <hr> <h3><strong>6. <code>tools/geometry_utils.py</code></strong></h3> <pre><code class="language-python">import math
class PointConstruction(Scene): def construct(self): dot_a = Dot(LEFT * 2, color=BLUE) dot_b = Dot(RIGHT * 2, color=RED) label_a = MathTex("A").next_to(dot_a, DOWN) label_b = MathTex("B").next_to(dot_b, DOWN) ```markdown # Lesson 1: Points, Lines, Rays, and
</code></pre> <p>manim>=0.17.0 numpy>=1.21.0 matplotlib>=3.5.0 jupyter>=1.0.0 ipywidgets>=7.6.0 pytest>=6.2.0 plotly>=5.10.0 sympy>=1.10</p> <pre><code> ---
def distance(p1, p2): """Euclidean distance between two points (x,y) tuples.""" return math.hypot(p1[0]-p2[0], p1[1]-p2[1]) Name rays and segments given endpoints
## Visuals (from `animations/point_construction.py`) - Animated dots appearing - Line extending beyond view - Ray starting at endpoint