How can I convert an area into a variable?

Cecilia Lucía Gigena shared this question 1 week ago
Answered

I have 2 triangles and I have used the Area function.

A_1=t1

A_1=t2


When I change the position of point B, triangle 1 disappears and triangle 2 shows up.

I want a text that says: area triangle = ...

And it has to tell t1 or t2 depending on which of those is shown.

So I want a number with if condition, that equals t1 or t2 depending on conditions to show triangle - and then use that number in the area text.

I tried e = t1 and nothing happens - it does not recognize I am refering to that area.

Comments (1)

photo
1

Maybe it's better to define just one triangle and just one rectange both conditionally according to y(B). You could do:

rect=Si(y(B) < y(A), Polígono(E, G, B, C), Polígono(E, A, D, C))

trian=Si(y(B) > y(A), Polígono(A, B, D), Polígono(A, B, G))

Doing so the rectangle and triangle are always defined, so you don't have any problem in your text referring to them.

chris

Files: area.ggb
© 2020 International GeoGebra Institute