Logical Operators
Logical And Operator
The logical 'and' operator evaluates to true if the expressions on both the LHS and RHS of the operator evaluate to true and false otherwise. The syntax for the logical 'and' operator is the double ampersand '&&'. Let's say that we want to require that Venus is in Taurus at the time of the event. One way to achieve this is by entering the following filter expression into the Event Filter:
Venus.Longitude >= 30 && Venus.Longitude < 60
The longitude of Venus must be greater than or equal to 30° and less than 60° for the expression to evaluate to true.
Logical Or Operator
The logical 'or' operator evaluates to false if the expressions on both the LHS and RHS of the operator evaluate to false and true otherwise. The syntax for the logical 'or' operator is the double pipe '||'. To print the pipe character, hold down the SHIFT key and tap the backslash key. Let's say that we want to require that the latitude of Mercury is greater than zero or the latitude of Venus is greater than zero at the time of the event. We would achieve this with the following filter expression:
Mercury.Latitude > 0 || Venus.Latitude > 0
In the case of the above example, if the latitude of Mercury is greater than zero and that of Venus is less than zero then the expression will evaluate to true. If either the LHS or RHS expression evaluates to true then the 'or' expression evaluates to true.
A Practical Example
Let's say that we are interested in conjunctions of Venus and Mars and we've created a Planetary Aspects study to find those events. Venus has been selected as the inner body and Mars as the outer body. The list of aspects contains one value which is zero.
We only want the conjunctions that occur when the latitude of Venus is within 1° of the latitude of Mars. To achieve this, all we need to do is realize that the latitude of Venus needs to be within a range that is determined by the latitude of Mars. When a value is within a range it must be greater than (or equal to) some minimum value and less than (or equal to) some maximum value.
A filter expression is required that checks if Venus's latitude falls within the 1° range of Mars's latitude. Here's how you could write it:
Venus.Latitude >= (Mars.Latitude - 1) && Venus.Latitude <= (Mars.Latitude + 1)
This expression will retain only the events where Venus's latitude is within 1° of Mars's latitude at the time of the conjunction.