public class ValPixConverter extends Object
Constructor and Description |
---|
ValPixConverter() |
Modifier and Type | Method and Description |
---|---|
static double |
pixToVal(float pix,
double min,
double max,
float lengthPix,
boolean flip)
Convert a value in pixels to the type passed into min/max
|
static double |
range(double min,
double max) |
static double |
valPerPix(double min,
double max,
float lengthPix) |
static float |
valToPix(double val,
double min,
double max,
float lengthPix,
boolean flip) |
static android.graphics.PointF |
valToPix(Number x,
Number y,
android.graphics.RectF plotArea,
Number minX,
Number maxX,
Number minY,
Number maxY)
Converts a real value into a pixel value.
|
public static float valToPix(double val, double min, double max, float lengthPix, boolean flip)
public static double range(double min, double max)
public static double valPerPix(double min, double max, float lengthPix)
public static double pixToVal(float pix, double min, double max, float lengthPix, boolean flip)
pix
- min
- max
- lengthPix
- flip
- True if the axis should be reversed before calculated. This is the case
with the y axis for screen coords.public static android.graphics.PointF valToPix(Number x, Number y, android.graphics.RectF plotArea, Number minX, Number maxX, Number minY, Number maxY)
x
- Real d (domain) component of the point to convert.y
- Real y (range) component of the point to convert.plotArea
- minX
- Minimum visible real value on the d (domain) axis.maxX
- Maximum visible real value on the y (domain) axis.minY
- Minimum visible real value on the y (range) axis.maxY
- Maximum visible real value on the y (range axis.