// Path: src/roquen/fake/Vect2f.java
// public class Vect2f {
//   public float x,y;
//   
//   public Vect2f set(float x, float y)
//   {
//     this.x=x; this.y=y;
//     return this;
//   }
//   
//   
//   /** */
//   private static final int HASH = hashMakeSeed(0);
//   
//   @Override
//   public int hashCode()
//   {
//     return hashComplete(hashAdd(HASH,x,y));
//   }
// }


import roquen.fake.Vect2f;

package roquen.interp;


/**
 * For performing in-order walks of cells on a uniform 2D grid which
 * are crossed by a line segment or ray. All covered cells are visited
 * however it does not provide supercoverage.  Supercoverage is when
 * all four cells are visited in the case where the ray passes through
 * a corner.  For a corner case this will visit three out of four. At
 * each step the next cell will be either a horizontal or vertical move
 * so in the extreme pathological case this will visit "false positive"
 * cells, the worst case situation begin a 45 degree angle ray
 * perfectly through corners where half the visited cells will be
 * "false positives".  These false positives only occur when hitting
 * a corner so is of no concern unless the use-case is something like
 * rayshooting from the center of a cell in only horizontal, vertical or
 * diagonal directions which isn't the intended usage.
 * <p>
 * Passed in values make the assumption that the extent of cells are
 * of one unit.  User code scaling is required for other sizes.
 */
public class RayGrid2D 
{
  private double cx,cy;
  private double ax,ay;

// Path: src/roquen/fake/Vect2f.java
// public class Vect2f {
//   public float x,y;
//   
//   public Vect2f set(float x, float y)
//   {
//     this.x=x; this.y=y;
//     return this;
//   }
//   
//   
//   /** */
//   private static final int HASH = hashMakeSeed(0);
//   
//   @Override
//   public int hashCode()
//   {
//     return hashComplete(hashAdd(HASH,x,y));
//   }
// }


// Path: src/roquen/interp/RayGrid2D.java
import roquen.fake.Vect2f;

package roquen.interp;


/**
 * For performing in-order walks of cells on a uniform 2D grid which
 * are crossed by a line segment or ray. All covered cells are visited
 * however it does not provide supercoverage.  Supercoverage is when
 * all four cells are visited in the case where the ray passes through
 * a corner.  For a corner case this will visit three out of four. At
 * each step the next cell will be either a horizontal or vertical move
 * so in the extreme pathological case this will visit "false positive"
 * cells, the worst case situation begin a 45 degree angle ray
 * perfectly through corners where half the visited cells will be
 * "false positives".  These false positives only occur when hitting
 * a corner so is of no concern unless the use-case is something like
 * rayshooting from the center of a cell in only horizontal, vertical or
 * diagonal directions which isn't the intended usage.
 * <p>
 * Passed in values make the assumption that the extent of cells are
 * of one unit.  User code scaling is required for other sizes.
 */
public class RayGrid2D 
{
  private double cx,cy;
  private double ax,ay;

  private int    ux,uy;
