xphysToXscreen method

double xphysToXscreen (double x)

Converts physical x coordinate to screen x coordinate, which is returned relative to the data area. NOTE: This method assumes x coordinates increasing vom left to right. Therefore for nmr we always feed in indexes! MUST have the type of PhysicalToScreen.

Implementation

double xphysToXscreen(double x) {
  // Formeln: Siehe Karo-Heft mit Blatt Datum 9. 12. 13
  double xscreen;
  if ((xmax - xmin).abs() < 0.000001) {
    xscreen = x;
//      print("x=$x $xmin");
  } else {
    xscreen = (x - xmin) * effectivePolylineWidth / (xmax - xmin) +
        insetx +
        xshift; // screen coord. relative to data area
  }
  return xscreen;
}