Constructing Triangles on a Square Grid (Advanced)

Constructing Triangles on a Square Grid (Advanced)
Loading the math board and drawing, please wait…
2020-04-02 20:41
This example demonstrates how to construct triangles on a square grid and provides a feature to check the answer. Core mathematical concepts include triangles, right triangles, and vectors. Using GeoGebra commands such as IndexOf, Segment, Sequence, and RandomElement, a fixed segment is constructed, and other segments are randomly generated to form a triangle. Suitable for high school students learning geometric construction and probability statistics.

GeoGebra Commands & Parameters

  1. IndexOf(SelectedElement[ListTriType], ListTriType) → TriType
  2. Segment(Blue1a, Blue1b) → SegBlue1
  3. Segment(Blue2a, Blue2b) → SegBlue2
  4. Sequence(Sequence[(s, t), s, 0, 25], t, -5, 13) → ListDots
  5. RandomElement({4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17}) → Redax12
  6. RandomElement({-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9}) → Reday12
  7. RandomElement({4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17}) → Redbx12
  8. RandomElement({-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9}) → Redby12
  9. RandomElement({4, 5, 6, 7, 8, 9}) → Reday3
  10. RandomElement({4, 5, 6, 7, 8, 9}) → Redby3
  11. RandomElement({9, 10, 11, 12, 13, 14, 15, 16, 17}) → Redax4
  12. RandomElement({4, 5, 6}) → Reday4
  13. Vector((1, 0)) → VecE
  14. Vector((0, 1)) → VecN
  15. Vector((0, -1)) → VecS
  16. Vector((-1, 0)) → VecW
  17. Vector((1, 1)) → VecNE
  18. Vector((1, -1)) → VecSE
  19. Vector((-1, 1)) → VecNW
  20. Vector((-1, -1)) → VecSW
  21. RandomElement({1, 2, 3, 4}) → RanLength
  22. RandomElement({8, 9, 10, 11, 12, 13, 14, 15}) → Redax3
  23. If(TriType ≟ 1 ∨ TriType ≟ 2, Redax12, TriType ≟ 3, Redax3, Redax4) → Redax
  24. If(TriType ≟ 1 ∨ TriType ≟ 2, Reday12, TriType ≟ 3, Reday3, Reday4) → Reday
  25. RandomElement({9, 10, 11, 12, 13, 14}) → Redbx3
  26. If(TriType ≟ 1 ∨ TriType ≟ 2, Redbx12, TriType ≟ 3, Redbx3, Redbx4) → Redbx0
  27. If(TriType ≟ 1 ∨ TriType ≟ 2, Redby12, TriType ≟ 3, Redby3, Redby4) → Redby
  28. If(Redax ≟ Redbx0 ∧ Reday ≟ Redby, Redbx0 + 1, Redbx0) → Redbx
  29. Segment(Reda, Redb) → SegRed

AI Drawing Prompt Reference

Draw a square grid with evenly spaced dots. Construct a fixed blue segment as a base. Then randomly generate another blue segment. Based on a selected triangle type, randomly generate a red segment whose endpoints are chosen from integer coordinates on the grid, ensuring the red segment does not overlap the blue endpoints. The red segment, together with the blue segments, forms a triangle. The grid covers a range of x from 0 to 25 and y from -5 to 13. Only the grid dots, blue segments, and red segment are shown, without axes.
The prompt above was compiled from the original drawing commands and is for reference only.