Properties
Category
English
Similar Topics
Statistics
Comments
7
Participants
5
Subscribers
0
Votes
1
Views
809
Share
Highlight Squares
Answered
I would like to be able to highlight each of the squares on the coordinate grid that the diagonal passes through on the attached applet. Any help in doing so would be appreciated.
 GeoGebra
 Help
 Partners

Contact us
 Feedback & Questions
 This email address is being protected from spambots. You need JavaScript enabled to view it.
 +43 677 6137 2693
© 2019 International GeoGebra Institute
Hi,
In the annex one possible solution.
Question: for what you need it?
Raymond
Annex: GG40
https://ggbm.at/551919
supplement GG40
A more mathematical solution (but slow)
https://ggbm.at/551917
The applet is for a problem that I'm interested in.
Given a rectangle with dimensions n x m, how may squares will the diagonal pass through?
Thank you. That applet is exactly what I needed.
Here is another implementation of this problem (sure this is not the best way to do it) in order to highlight the squares.
I defined two sliders m and n.
In spreadsheet I define A2:A20 and B1:L1 with numbers from 1 to 19 (m and n values), and cell B2 with the first desired polygon (as list formed only with the polygon as unique element; if you don't do as a list you get more not desired cells in the spreadsheet containing vertex coordinates, and that is not desired in this situation):
'={Polygon[($A2, B$1), ($A2, B$1) + (1, 0), ($A2, B$1) + (1, 1), ($A2, B$1) + (0, 1)]}'.
After that, I wrote for element stored in B2 the following dynamic color code: If[(y(Vertex[Element[B2, 1], 2]) / x(Vertex[Element[B2, 1], 2]) ≤ n / m) ∧ (n / m ≤ y(Vertex[Element[B2, 1], 4]) / x(Vertex[Element[B2, 1], 4])), 1, 0].
Then I copied cell B2 to range B2:L19 (this copies the cell definition and the dynamic color code too!!).
I'm sure this is not the best solution to the question you asked for, but one week ago I learned here about coping dynamic color code and scripting code from one cell to a big range of cells (was told to me by kondr in this forum) and I find this technic very usefull in many situations.
Cheers
https://ggbm.at/551915
hello
an old work for course in
http://www.ite.educacion.es/formacion/materiales/123/cd/06/index.html
la plaza
https://ggbm.at/551921
saludos
Hi,
Or..
If the tiles have a variable size.
Raymond
Annex GG40
https://ggbm.at/551925
@rami
You're amazing. Thanks. These applets will surely help with future constructions.
Very clever solution, Raymond. I took the liberty of tweaking your diagonal1 so that the rectangle can be moved to arbitrary position.
cheers,
JohnG
https://ggbm.at/551941
Comments have been locked on this page!