GeoGebra Removes Parentheses Necessary for Evaluation
I am working on a demonstration of gear shapes and have run into an issue when using an IF statement in a parametric equation. I am using the XOR operator to link two expressions that output Boolean values:
If(IsInteger(k / 4) ⊕ (h(θ, d) ≤ 0), <Then>, <Else> )("Then" and "Else" statements removed for brevity)
Where the first expression checks if the number of teeth on the gear (half of the slider-value "k") is even, and the second expression checks if the output of the function "h(x,y)" is less than zero when given the inputs "θ" (from the parametric equation) and "d" (the rotational distance).
This evaluates as expected, with one caveat: when GeoGebra processes this input, it removes the parentheses around the second expression. If anything happens after this point to cause GeoGebra to re-evaluate the parametric equation - including the act of opening the file - it throws an error at the IF statement and replaces the entire parametric equation's definition with "?".
This is what the IF statement is changed to:
If(IsInteger(k / 4) ⊕ h(θ, d) ≤ 0, <Then>, <Else> )This is the error I get:
Illegal Boolean operation null = false ∨ 0Is there a way to force GeoGebra to leave the parentheses in, or a better way to set this up?
Please try the new version (v453)
try
sometimes it works
yes
I think there is a bug with xor symbol . I hope developers solve it
meantime you can try
try If((0 ≤ x(E)) != IsInteger(k / 4) , , )
Hi!
I saw this thread ( https://help.geogebra.org/t... ) and thought ...
Probably it's a bug, but perhaps the problem can be solved by setting paranthesis in another way.
Would you please send a file "minimal example" (like in LaTeX ;-) ) to try out?
kind regards
mire2
Ok, another simple idea.
Knowing that "(A XOR B)" is equivalent to "¬(A==B)" what happens now?
Upps - it's the same idea mathmagic posted.
Please try the new version (v453)
Comments have been locked on this page!