Skip to content

Plane Geometry

The "Plane Geometry" page is used to define plane figures (points, lines, segments, triangles, polygons, circles) and plot them with Matplotlib. Defined objects are stored in the main window's pjs dictionary ({name: (category, sympy object)}) and are shared with the "Plane Geometry Calculation" and "Plane Geometry Plot" pages.

Defining Objects

On the "Plane Geometry" page, choose a construction method, enter a name and parameters, then click Save (or press Enter) to create the object. Objects appear in the category list below, where you can Read (view name and equation / expression) or Delete them.

# Construction method Parameters (comma-separated) Category
1 Point (coordinates) x, y Point
2 Line through two points point1, point2 Line
3 Circle by center and radius center, radius Circle
4 Circle through three points (circumcircle) p1, p2, p3 Circle
5 Triangle through three points p1, p2, p3 Triangle
6 Polygon through vertices p1, p2, ... Polygon
7 Circle with diameter endpoints p1, p2 Circle
8 Circle by center and a point on it center, point_on_circle Circle
9 Perpendicular bisector of a segment segment_name Line
10 Parallel line through a point point, line_or_segment Line
11 Perpendicular line through a point point, line_or_segment Line
12 Angle bisector of two intersecting lines line1, line2 Line
13 Angle bisector (p2 is the vertex) p1, p2, p3 Line
14 Triangle median triangle, vertex_index(0/1/2) Segment
15 Triangle altitude triangle, vertex_index(0/1/2) Line
16 Triangle midsegment triangle Segment
17 Triangle incircle triangle Circle
18 Triangle excircle triangle, vertex_index(0/1/2) Circle
19 Segment through two points p1, p2 Segment

Note

The object "name" is entered in the name input box (e.g. A, l1); "point1" in parameters refers to the name of an already defined object. Coordinates and radius accept SymPy expressions such as sqrt(2) or pi/2.

Property Panel

Select an object in the list and click Read to show its name and equation / expression (lines and circles show their equation; points show coordinates) in the property panel; click Delete to remove it.

Plotting

On the "Plane Geometry Plot" page, defined objects are shown as a checkable list (all checked by default). Check the objects you want to display and click Plot to render a 2D image with Matplotlib:

  • Points, lines, segments, triangles, polygons, and circles can be displayed together.
  • Each object is labeled with its name automatically.
  • The toolbar provides Home / Pan / Zoom / Save; the mouse wheel zooms.
  • The image is re-rendered automatically when switching between light / dark themes.

It is implemented by draw2d in functions/paint2D.py. For calculations such as area, perimeter, and angles of these objects, use the "Plane Geometry Calculation" page — see Plane Geometry Calculation.

Example

  1. Define three points A(0,0), B(2,0), C(0,1).
  2. Use method 5 to create triangle tri (parameters A,B,C).
  3. Switch to the "Plot" page, check A, B, C, tri, and click Plot to see the triangle with its vertices.

Tips

  • Coordinate / radius input follows the String Parsing standard.
  • After defining objects, the "Plane Geometry Calculation" page offers 32 operations on them (distance, triangle area, etc.).