Difference between revisions of "Boolean values"
From GeoGebra Manual
(added interlink and example of use) |
(added missing operators) |
||
Line 27: | Line 27: | ||
|numbers, points, lines, conics, functions (needs CAS), planes, a, b | |numbers, points, lines, conics, functions (needs CAS), planes, a, b | ||
|- | |- | ||
− | | | + | |Not equal |
|≠ | |≠ | ||
|!= | |!= | ||
Line 61: | Line 61: | ||
|&& | |&& | ||
|a ∧ b or a && b | |a ∧ b or a && b | ||
− | | | + | |booleans a, b |
|- | |- | ||
|Or | |Or | ||
Line 67: | Line 67: | ||
|<nowiki>||</nowiki> | |<nowiki>||</nowiki> | ||
|a ∨ b or <nowiki>a || b</nowiki> | |a ∨ b or <nowiki>a || b</nowiki> | ||
− | | | + | |booleans a, b |
|- | |- | ||
|Not | |Not | ||
Line 73: | Line 73: | ||
|! | |! | ||
|¬a or !a | |¬a or !a | ||
− | | | + | |boolean a |
+ | |- | ||
+ | |Exclusive or | ||
+ | | | ||
+ | |{{KeyCode|Alt}}{{KeyCode|+}} | ||
+ | |a ⊕ b | ||
+ | |booleans a, b | ||
+ | |- | ||
+ | |Implication | ||
+ | |→ | ||
+ | |<nowiki>-></nowiki> | ||
+ | |a -> b | ||
+ | |booleans a and b | ||
|- | |- | ||
|Parallel | |Parallel | ||
Line 92: | Line 104: | ||
|a ∈ list1 | |a ∈ list1 | ||
|number a, list of numbers list1 | |number a, list of numbers list1 | ||
+ | |- | ||
+ | |Subset | ||
+ | |⊆ | ||
+ | | | ||
+ | |list1 ⊆ list2 | ||
+ | |lists list1 and list2 | ||
+ | |- | ||
+ | |Proper subset | ||
+ | |⊂ | ||
+ | | | ||
+ | |list1 ⊂ list2 | ||
+ | |lists list1 and list2 | ||
+ | |- | ||
|} | |} |
Revision as of 15:29, 18 August 2022
You can use the Boolean variables true and false in GeoGebra. Just type, for example,
a = true
or b = false
into the Input Bar and press the Enter key.
With Boolean variables you can e.g. define the conditional visibility of an object.
Check Box and Arrow Keys
Free Boolean variables can be displayed as check boxes in the Graphics View (see tool Check Box Tool). After selecting a Boolean variable in the Algebra View you can use the arrow keys to change the value of the Boolean variable (see Manual Animation).
Note: You may also use Boolean variables like numbers (value 0 or 1). This allows you to use a checkbox as the dynamic speed of an animated slider allowing you to start and stop the animation. In this case, the animation button is only shown in the Graphics View if there is also an animated slider with static (i.e. non-dynamic) speed.
Operations
You can use the following operations for Boolean variables and conditions in GeoGebra by either selecting them from the list next to the Input Bar or by entering them using the keyboard:
Operation | List | Keyboard | Example | Object types |
---|---|---|---|---|
Equal | ≟ | == | a ≟ b or a == b | numbers, points, lines, conics, functions (needs CAS), planes, a, b |
Not equal | ≠ | != | a ≠ b or a != b | numbers, points, lines, conics, functions (needs CAS), planes a, b |
Less than | < | a < b | numbers a, b | |
Greater than | > | a > b | numbers a, b | |
Less or equal than | ≤ | <= | a ≤ b or a <= b | numbers a, b |
Greater or equal than | ≥ | >= | a ≥ b or a >= b | numbers a, b |
And | ∧ | && | a ∧ b or a && b | booleans a, b |
Or | ∨ | || | a ∨ b or a || b | booleans a, b |
Not | ¬ | ! | ¬a or !a | boolean a |
Exclusive or | Alt+ | a ⊕ b | booleans a, b | |
Implication | → | -> | a -> b | booleans a and b |
Parallel | ∥ | a ∥ b | lines a, b | |
Perpendicular | ⊥ | a ⊥ b | lines a, b | |
Belongs to | ∈ | a ∈ list1 | number a, list of numbers list1 | |
Subset | ⊆ | list1 ⊆ list2 | lists list1 and list2 | |
Proper subset | ⊂ | list1 ⊂ list2 | lists list1 and list2 |