toPixels
package
enum toPixels =
q{
double toPixelsX(double inUnits) {
immutable xRange = rightLim - leftLim;
// This handles the case of plots that are infinitely small in one
// direction. Using <= instead of == to handle rounding error.
if(xRange <= 0) return leftMargin;
immutable fract = (inUnits - leftLim) / xRange;
immutable ret = (fract * plotWidth) + leftMargin;
return ret;
}
double toPixelsY(double inUnits) {
immutable yRange = upperLim - lowerLim;
// This handles the case of plots that are infinitely small in one
// direction. Using <= instead of == to handle rounding error.
if(yRange <= 0) return topMargin;
immutable fract = (upperLim - inUnits) / yRange;
immutable ret = (fract * plotHeight) + topMargin;
return ret;
}
};
plot2kill util
functionsmanifest constantsstructsvariables