Properties
Category
English
Similar Topics
Statistics
Comments
10
Participants
6
Subscribers
6
Votes
1
Views
118
Share
Sum of area of all polygons
Answered
Hello, I am wondering if there is possible to get the sum of the area of all polygons in one file. I have a file where my students can create a lot triangles and rectangles by custom tools. I want the geogebrafile to check whether the total area of the polygons in the file are a spesific number.
I appreciate if anyone has a solution to my problem.
 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
© 2020 International GeoGebra Institute
you can count the sum of polygons by a simple sum. You can put all polygons in a file in one list l1 and the calculate Sum(l1) to get the sum of all polygons. But there's no command that will count automaticly all areas for you
chris
Or just sum the areas manually, e.g. if you have a triangle t1, a quadrilateral q1, and a circle p enter:
The Area() command is needed to calculate the area of a conic
You can use commands for not yet defined objects since you knwo how they will be named: t1, ... or in general tn. In an Execute command you can use a counter n as variable and mix this variable with absolute text, append the new obect to a list of objects and make the sum of the lists. But this requires the objects to be created by eg a button that contains this script.
If you just freely create an object, this will not be part of a list, the category of triangles, etc is not a list as such.
quizás el adjunto te sea util pues en la lista quedan reflejados todos los triangulos y sus nombres lo que permite seleccionar cuales objetos queremos sumar
el archivo tiene un grave problema con la version 5 pues además de que no funciona en absoluto se produce un fallo general que no permite construir nada
veré qué se puede hacer con este bug
Thanks for trying to help. I am not sure I understood your comments.
@ccambre: Your solution seems great. Can you give an example of how the execute command would look like.
I am trying to reformulate my problem in the first place:
I have a file with a simple figure like this one in the attachement. I want my students to open the file and make polygons (inside my polygon) to "shade" the original polygon in a way that half of the polygons area is shaded. One possible to way is to define a lot of small clickable squares. Then the student can click on the small squares and by a script the squares can be shaded when clicking. But I want to give my students the opportunity to shade in more interesting ways, perhaps by shading triangles also. I also want the opportunity of using one, two, three, or another number of shaded parts. Therefore I want a way that the program automatically can calculate the area of shaded polygons (the polygons the students make) and then check whether or not this is half the original polygon.
a possible solution
The fact that triangles and squares are named with the prefix t or q and a sequence number is used. The list of the two polygon types is determined automatically (even if there are gaps in the sequence number or the sequence number does not begin with 1 (e.g. by deletion)).
Note: t0 and q0 are dummy polygons with value 0 because the first element of the sequence can't be undefined.
si no funcionase por favor avise
simplemente cree varios triangulos
https://www.geogebra.org/m/yjgzsxwv
here attached an example:
clic on t1, t2
Comments have been locked on this page!