## FCSys.Utilities.Coordinates

Functions to handle Cartesian coordinates

### Information

Extends from Modelica.Icons.Package (Icon for standard packages).

### Package Content

Name | Description
--- | ---
after | Return the axis following a given axis in Cartesian coordinates
before | Return the axis preceding a given axis in Cartesian coordinates
cartWrap | Return the index to a Cartesian axis (1 to 3 or Axis.x to Axis.z) after wrapping

## FCSys.Utilities.Coordinates.after

Return the axis following a given axis in Cartesian coordinates

### Information

Example:
`after(Axis.z)` or `after(3)` returns 1, which is equivalent to `Axis.x`.

Extends from Modelica.Icons.Function (Icon for functions).

### Inputs

Type | Name | Default | Description
--- | --- | --- | ---
Axis | axis |  |

### Outputs

Type | Name | Description
--- | --- | ---
Axis | after |

### Modelica definition

    function after
      "Return the axis following a given axis in Cartesian coordinates"
      extends Modelica.Icons.Function;

      input Axis axis;
      output Axis after;

    algorithm
      after := cartWrap(axis + 1);

    end after;

## FCSys.Utilities.Coordinates.before

Return the axis preceding a given axis in Cartesian coordinates

### Information

Example:
`after(Axis.x)` or `after(1)` returns 3, which is equivalent to `Axis.z`.

Extends from Modelica.Icons.Function (Icon for functions).

### Inputs

Type | Name | Default | Description
--- | --- | --- | ---
Axis | axis |  |

### Outputs

Type | Name | Description
--- | --- | ---
Axis | after |

### Modelica definition

    function before
      "Return the axis preceding a given axis in Cartesian coordinates"
      extends Modelica.Icons.Function;

      input Axis axis;
      output Axis after;

    algorithm
      after := cartWrap(axis - 1);

    end before;

## FCSys.Utilities.Coordinates.cartWrap

Return the index to a Cartesian axis (1 to 3 or Axis.x to Axis.z) after wrapping

### Information

Examples:
`cartWrap(0)` returns 3 and `cartWrap(4)` returns 1.

Extends from mod1 (Modulo operator for 1-based indexing (compatible with Modelica)).

### Inputs

Type | Name | Default | Description
--- | --- | --- | ---
Integer | num |  | Dividend
Integer | den | Axis.z | Divisor

### Outputs

Type | Name | Description
--- | --- | ---
Integer | index | Remainder with 1-based indexing

### Modelica definition

    function cartWrap = mod1 (final den=Axis.z)
      "Return the index to a Cartesian axis (1 to 3 or Axis.x to Axis.z) after wrapping";