uk.ac.starlink.ttools.plot2.layer
Class Gridder

java.lang.Object
  extended by uk.ac.starlink.ttools.plot2.layer.Gridder

public class Gridder
extends Object

Maps positions on a 2-d grid to a 1-d index.

Since:
15 Feb 2013
Author:
Mark Taylor

Constructor Summary
Gridder(int nx, int ny)
          Constructor.
 
Method Summary
 int getHeight()
          Returns grid height.
 int getIndex(int ix, int iy)
          Returns the 1-d index corresponding to a given x,y position.
 int getLength()
          Returns the number of points in the grid and array.
 int getWidth()
          Returns grid width.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Gridder

public Gridder(int nx,
               int ny)
Constructor.

Parameters:
nx - grid width
ny - grid height
Method Detail

getWidth

public int getWidth()
Returns grid width.

Returns:
width

getHeight

public int getHeight()
Returns grid height.

Returns:
height

getIndex

public int getIndex(int ix,
                    int iy)
Returns the 1-d index corresponding to a given x,y position.

Parameters:
ix - x position
iy - y position
Returns:
array index

getLength

public int getLength()
Returns the number of points in the grid and array.

Returns:
size


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.