Using Intermediate Variables

Using Intermediate Variables

Top 

As described in Calculating Output, the application expresses results in terms of:

  • variables youve added, and
  • additional variables the application added, if you havent fully specified the drawing.

However, expressions can sometimes be so large and complex as to be difficult to read and understand. To make output expressions clearer and more compact, you can choose to use intermediate variables.

An intermediate variable is a variable defined in the same terms your own variables plus those the system added for the purpose of simplifying an expression and enhancing its readability. Not every expression needs or can benefit from intermediate variables, but for some expressions, their use allows one straightforward name to replace a significant portion of the expression.

You can control how Geometry Expressions handles intermediate variables in three ways:

  • An Intermediate Variable Complexity setting determines how complex an intermediate variable must be before it appears in an expression.
  • A Use Intermediate Variables field determines whether, above this threshold, they appear or not.
  • A Show Intermediate Variables field affects their display.

These three settings interact with each other to let you control the calculations that Geometry Expression performs and how it presents them.

Intermediate Variable Complexity is an application setting, available from Edit > Preferences. From the Math tab, this option allows you to set a threshold for intermediate variable complexity in terms of a number from 2 to 100. This number determines the complexity of the term to be replaced with a variable in an expression.

A low number tells the application to replace even simple terms with intermediate variables, so you'll see more of these variables. A progressively higher number means that intermediate variables will represent progressively larger and more complex terms in expressions, so you'll see fewer of them.

Use Intermediate Variables, a drop down list (in Output section of Math tab of Preferences dialog box and in output Display Properties dialog), determines whether intermediate variables above the complexity threshold are used or not. When set to True, terms more complex than the threshold will be replaced by intermediate variables in expressions. Terms simpler than the threshold are not replaced.

When set to False, intermediate variables never appear and the threshold has no effect.

Show Intermediate Variables, also a drop down list (in Output section of Math tab of Preferences dialog box and in output Display Properties dialog), determines whether intermediate variable definitions are displayed with results. When set to True, youll see the results, including intermediate variables, followed by additional lines displaying the definition of each intermediate variable used.

When set to False, youll see intermediate variables in expressions according to the other two settings, but not their definitions.

Show Intermediate Variables affects only how an expression is displayed; it has no effect on the underlying expression itself. And its relevant only when Use Intermediate Variables is set to True. When Use Intermediate Variables is set to False, there are no intermediate variables to display.

Preferences (Math Output) 

Display Properties(Output) 

To summarize:

  • Intermediate Variable Complexity sets a threshold above which intermediate variables are used to calculate expressions, and appear in them. They thus affect the details of the expression thats calculated, as well as affecting the expressions readability.
  • Use Intermediate Variables determines whether to use intermediate variables above the threshold, or not. This also affects the details of expressions.
  • Show Intermediate Variables determines whether to display the definitions of intermediate variables when they are present.