FCSys.Utilities.Coordinates

Functions to handle Cartesian coordinates

Information

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

Package Content

NameDescription
FCSys.Utilities.Coordinates.after after Return the axis following a given axis in Cartesian coordinates
FCSys.Utilities.Coordinates.before before Return the axis preceding a given axis in Cartesian coordinates
FCSys.Utilities.Coordinates.cartWrap cartWrap Return the index to a Cartesian axis (1 to 3 or Axis.x to Axis.z) after wrapping

FCSys.Utilities.Coordinates.after 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

TypeNameDefaultDescription
Axisaxis  

Outputs

TypeNameDescription
Axisafter 

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 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

TypeNameDefaultDescription
Axisaxis  

Outputs

TypeNameDescription
Axisafter 

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 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

TypeNameDefaultDescription
Integernum Dividend
IntegerdenAxis.zDivisor

Outputs

TypeNameDescription
IntegerindexRemainder 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";