public class MapCoordConverter extends Object
Constructor and Description |
---|
MapCoordConverter() |
Modifier and Type | Method and Description |
---|---|
static int |
findIndex(double[] ar,
double val,
double tol)
Find index of element val in array with tolerance.
|
static int |
findPointIndex(double[] xmap,
double[] ymap,
double x,
double y,
double tol)
Find point defined by xmap and ymap for given frame which is closest to another point (x;y)
within tolerance.
|
static Point2D.Double |
toCartesian(STmap mapCell,
int frame,
double outlinePos,
double tol)
Convert (Frame;Outline) to Cartesian (x;y).
|
static Point2D.Double |
toMap(STmap mapCell,
int frame,
double x,
double y,
double tol)
Convert Cartesian coordinates for given frame to map coordinates (frame;outlinePos).
|
public static Point2D.Double toCartesian(STmap mapCell, int frame, double outlinePos, double tol)
mapCell
- structure with maps.frame
- frame coordinate (from 0)outlinePos
- position on the outline to converttol
- tolerance to match outlinePos to coordinates in mapCell defined as
: |coordMap[frame] - outlinePos|.public static Point2D.Double toMap(STmap mapCell, int frame, double x, double y, double tol)
mapCell
- structure with mapsframe
- frame to look inx
- Cartesian coordinate of pointy
- Cartesian coordinate of pointtol
- defined maximal distance between point.public static int findPointIndex(double[] xmap, double[] ymap, double x, double y, double tol)
xmap
- map of x coordinates for one frameymap
- map of y coordinates for one framex
- x coordinate for searched pointy
- y coordinate for searched pointtol
- maximum distance between points.public static int findIndex(double[] ar, double val, double tol)
ar
- array to look forval
- value to findtol
- toleranceCopyright © 2002–2019 Department of Computer Science, Warwick University. All rights reserved.