Class Elias

java.lang.Object
squidpony.squidmath.Elias
All Implemented Interfaces:
Serializable

public class Elias
extends Object
implements Serializable
Contains methods to draw anti-aliased lines based on floating-point coordinates.
Because of the way this line is calculated, endpoints may be swapped and therefore the list may not be in start-to-end order.
Based on work by Hugo Elias at http://freespace.virgin.net/hugo.elias/graphics/x_wuline.htm which is in turn based on work by Wu.
Author:
Eben Howard - http://squidpony.com - howard@squidpony.com
See Also:
Serialized Form
  • Constructor Details

  • Method Details

    • lightMap

      public double[][] lightMap​(double startx, double starty, double endx, double endy)
    • line

      public ArrayList<Coord> line​(double startx, double starty, double endx, double endy)
      Gets the line between the two points.
      Parameters:
      startx -
      starty -
      endx -
      endy -
      Returns:
    • line

      public ArrayList<Coord> line​(double startx, double starty, double endx, double endy, double brightnessThreshold)
      Gets the line between the two points.
      Parameters:
      startx -
      starty -
      endx -
      endy -
      brightnessThreshold - between 0.0 (default) and 1.0; only Points with higher brightness will be included
      Returns:
    • line

      public ArrayList<Coord> line​(Coord start, Coord end)
    • line

      public ArrayList<Coord> line​(Coord start, Coord end, double brightnessThreshold)
    • getLastPath