Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space DEV and version next

D toc

Excerpt

Computes the positive or negative sign of a given numeric value. The value can be a Decimal or Integer literal, a function returning Decimal or Integer, or a reference to a column containing numeric values. 

  • For positive values, this function returns 1
  • For negative values, this function returns -1.
  • For the value 0, this function returns 0.

...

Using these two columns, you can assign each set of coordinates into a quadrant:

D code

case cases: [(signX == 1) && (signY == -1),'lower-right'],[(signX == 1) && (signY == 1),'upper-right'],[(signX == -1) && (signY == -1),'lower-left'],[(signX == -1) && (signY == 1),'upper-left'] default: 'line' as: 'quadrant'

Results:

XYsignXsignYquadrant
-24-11upper-left
-6.2-2-1-1lower-left
0-4.20-1line
4411upper-right
15-0.051-1lower-right

...