TODO - screenshots to take (remove this box before publishing)
c:geo offers a calculator for waypoints, which allows to make use of variables and formulas to calculate coordinates based on the result.
Once you tapped on Calculate Coordinates in the coordinate input dialog the calculator will be shown.
The button will close the calculator without changes, the
(or the
Done button at the bottom, depending on your device) will close it, take over the changes and return to the waypoint editor.
Closing the calculator does not yet persist the calculator state. Be sure to also save the waypoint afterwards if you want to keep the state of the calculator.
You can use the calculator also for preparing your field trip by entering the needed formulas but not yet entering values for your variables.
This will of course not yet provide a valid result, but you can still save the current state at any time by closing the calculator and afterwards saving the waypoint. You can return later to enter the missing values as soon as you found them.
The calculator consists of the following sections (from top to bottom):
Convert to plain Coordinate, Generate Waypoints and Done
The switch Guided Mode at the top selects how the coordinate formulas are entered:
DDD.DDDDD°, DDD°MM.MMM' or DDD°MM'SS.SSS").When switching between the modes c:geo tries to keep your input. If the formulas can't be represented in a guided format, the calculator stays in Plain mode.
By default the guided mode starts with the coordinates of the waypoint (or the cache) as a starting point. Each digit is represented by a button. The hemisphere buttons (N/S and E/W) can be tapped to toggle between the two values.
Value field appears in which you can enter a fixed digit, a variable (e.g. A) or even a complete formula (e.g. A+B) for this digit. Entering more than one digit as a value allows solutions where one variable results in several digits.Select Variable dialog. It offers to:Digits to which a variable or formula is assigned are shown with a variable icon.
All variables used in the coordinate formulas are listed below the coordinate input. They are listed automatically as soon as they are used. The variables are shared with the Variables tab of the cache, so values entered here are also available there (and vice versa) and can be used by all waypoints of the cache.
For each variable you can enter either
5 or a text), orA+B*2) calculating the value from other variables.The result of each variable is shown next to it. A formula button next to the input field lets you pick a function (see below) from a list.
Further buttons:
Tidy Up - cleans up the variable list: it adds all variables missing for the current formulas, removes empty variables which nobody needs, adds empty entries for variables still missing and finally sorts all variables.
Variable names are case sensitive. A and a are different variables. Variables used in the coordinate formulas typically are single letters. Variables with longer names can be referenced with a leading $ (e.g. $Name or ${Name}).
Formulas may use the following operators:
| Operator | Function | Example |
|---|---|---|
| + | Addition | A+B |
| - | Subtraction | A-B |
| * | Multiplication (also ×, •, ⋅) | A*B |
| / | Division (also : and ÷) | A/B |
| % | Modulo | A%10 |
| ^ | Power (also ² and ³) | A^B |
| ! | Factorial | A! |
| ( ) or [ ] | Parenthesis | (A+B)*C |
| <, >, ⇐, >=, ==, <> | Comparison (result is 1 for true, 0 for false) | A>B |
| ' ' or “ “ | Text constant | 'abc' |
| _ | Marks an “overflow” digit (no value) | _5 |
| #…# | Comment, ignored by the calculation | A+B #my note# |
Several variables or numbers directly written next to each other are concatenated: AB with A=1 and B=2 results in 12.
The following functions are available (several have alternative short names):
| Group | Function | Description |
|---|---|---|
| Simple Numeric | sqrt(x) | Square root |
| sin(x), cos(x), tan(x) | Trigonometric functions (in degree) | |
| abs(x) | Absolute value | |
| round(x) / rd(x) | Round | |
| trunc(x) / tr(x) / floor(x) / fl(x) | Remove decimal places | |
| Complex Numeric | if(cond; then; else) | Conditional |
| checksum(x) / cs(x) | Sum of digits | |
| ichecksum(x) / ics(x) | Iterative sum of digits until one digit remains | |
| Aggregate Numeric | add(…) / sum(…) | Sum of the given values or range, e.g. add(A-C) |
| multiply(…) / product(…) / prod(…) | Product | |
| min(…) / max(…) | Smallest / largest value | |
| count(…) / cnt(…) | Number of values | |
| average(…) / avg(…) | Average | |
| Simple String | length(s) / len(s) | Number of characters |
| substring(s;start;length) / substr / sub | Part of a text | |
| chars(s;from;to) / ch | Selected characters | |
| Complex String | rot13(s) | Rotate characters by 13 |
| rot(s;n) | Rotate characters by n | |
| lettervalue(s) / lv / wordvalue / wv / bww | Sum of letter values (A=1, B=2, …) | |
| roman(s) | Convert a roman number to decimal | |
| vanity(s) / vanitycode / vc | Phone keypad (vanity) code |
Function parameters are separated by ;.
Inside a formula a range can be given as [:0-9] or as a list [:0,2,7] (combinations like [:1-3,7] are possible). This is used by the Generate Waypoints function described below.
While you enter formulas and variable values, the resulting latitude and longitude are shown on the fly in the result section below the variables.
Digits that can't be calculated yet (e.g. due to missing values) are replaced by * and greyed out. Once the result produces valid coordinates the result is shown with all white characters.
The notes section at the end of the calculator can be used to enter or paste notes, which can be helpful to e.g. copy parts of the cache description containing the calculations required to find the cache.
The content of the calculator note will be synchronized to the note of the waypoint used to calculate.
Convert to plain Coordinate replaces the calculation by the currently calculated, fixed coordinates and closes the calculator. The waypoint will no longer be a calculated waypoint.
If the formulas do not yet evaluate to valid coordinates you will be asked for confirmation, as converting will then reset the waypoint to empty coordinates.
If you do not know the exact value of one or several variables, but only a range of possible values, you can use ranges in the variables (e.g. [:0-9] or [:0,2,7]) and tap Generate Waypoints. c:geo will calculate all combinations, drop those which do not result in valid coordinates and show the rest in a list.
You can then select the coordinates which should be added as new waypoints (type Generated, name prefix “Generated”) to your cache or show them on the map.
If no variable with a valid range is found or no combination results in valid coordinates, a corresponding message will be shown.
In Plain mode there are two free text fields to enter the latitude and longitude part of a coordinate.
A single digit or a group of digits can be replaced by a formula surrounded with parenthesis. The variables used in the formulas must consist of single letters (typically CAPITAL letters).
Often cache listings provide their waypoint coordinates already in this expected format. Therefore the plain mode is best suited when coordinates should be taken over “as is” from the listings.
Useful helpers in plain mode:
Paste from clipboard - scans the clipboard for a coordinate (with or without formulas) and fills both fields. The button is only enabled if the clipboard contains a recognizable coordinate.Plain Tools (magic wand) - offers Remove spaces and Replace 'x' with '*' to fix typical problems of coordinates copied from listings.
The Plain mode works best with coordinates in MinDeg format DDD° MM.MMM'.
Taking an example like N 45° 5.(K)(I/N)(K+L+M+N), copy the latitude (N/S) part of the coordinate into the first input field and the longitude (E/W) part into the second. If the coordinate contains formulas with variables the corresponding variable input fields appear below. You can fill them in the same way as described in Variables.
As soon as the input for all variable fields is complete the result turns white and shows the calculated coordinate.
In some cases the result stays grey because the coordinate parser could not interpret the initial coordinate input correctly, e.g. because of a misplaced SPACE character between two digits of the same group.
Typical problems with coordinates copied from listings are:
N45° 5.(K) (I/N)(K+L+M+N)N45 ° 5.(K)(I/N)(K+L+M+N)N45° 5 .(K)(I/N)(K+L+M+N)N45° 5. (K)(I/N)(K+L+M+N)-) and a few common alternatives are acceptedx is taken as multiplier sign instead of an asterisk (*) - use the Plain Tools to replace itAs with the guided mode, the state of the calculator can be saved at any time.
Waypoints calculated with the calculator of older c:geo versions are migrated to the new calculator. When you edit such a waypoint, c:geo shows a Waypoint Migration dialog explaining the suggested new formula and variables. You can
Migrate - take over the suggested migration,Dismiss data - drop the old calculation data for good, orCancel - continue without migration. You will be asked again the next time. Note that editing the waypoint coordinates might delete the local calculation data.Migrated or dismissed data is documented in the user note of the waypoint.