public class Bresenham
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static Coord[] |
line2D_(Coord a,
Coord b)
Generates a 2D Bresenham line between two points.
|
static Coord[] |
line2D_(int startx,
int starty,
int endx,
int endy)
Generates a 2D Bresenham line between two points.
|
static Coord[] |
line2D_(int startx,
int starty,
int endx,
int endy,
int maxLength)
Generates a 2D Bresenham line between two points, stopping early if
the number of Coords returned reaches maxLength..
|
static java.util.Queue<Coord> |
line2D(Coord a,
Coord b)
Generates a 2D Bresenham line between two points.
|
static java.util.Queue<Coord> |
line2D(int startx,
int starty,
int endx,
int endy)
Generates a 2D Bresenham line between two points.
|
static java.util.Queue<Coord> |
line2D(int startx,
int starty,
int endx,
int endy,
int maxLength)
Generates a 2D Bresenham line between two points, stopping early if
the number of Coords returned reaches maxLength.
|
static java.util.Queue<Coord3D> |
line3D(Coord3D a,
Coord3D b)
Generates a 3D Bresenham line between two points.
|
static java.util.Queue<Coord3D> |
line3D(int startx,
int starty,
int startz,
int endx,
int endy,
int endz)
Generates a 3D Bresenham line between the given coordinates.
|
public static java.util.Queue<Coord> line2D(Coord a, Coord b)
Queue
interface for the returned reference, consider
using line2D_(Coord, Coord)
to save some memory.a
- the starting pointb
- the ending pointa
and b
.public static Coord[] line2D_(Coord a, Coord b)
a
- the starting pointb
- the ending pointa
and b
.public static java.util.Queue<Coord3D> line3D(Coord3D a, Coord3D b)
a
- Coord to start from. This will be the first element of the listb
- Coord to end at. This will be the last element of the list.public static java.util.Queue<Coord3D> line3D(int startx, int starty, int startz, int endx, int endy, int endz)
startx
- the x coordinate of the starting pointstarty
- the y coordinate of the starting pointstartz
- the z coordinate of the starting pointendx
- the x coordinate of the starting pointendy
- the y coordinate of the starting pointendz
- the z coordinate of the starting pointpublic static java.util.Queue<Coord> line2D(int startx, int starty, int endx, int endy)
Queue
interface for the returned reference, consider
using line2D_(int, int, int, int)
to save some memory.
startx
- the x coordinate of the starting pointstarty
- the y coordinate of the starting pointendx
- the x coordinate of the starting pointendy
- the y coordinate of the starting pointpublic static java.util.Queue<Coord> line2D(int startx, int starty, int endx, int endy, int maxLength)
Queue
interface for the returned reference, consider
using line2D_(int, int, int, int, int)
to save some memory.
startx
- the x coordinate of the starting pointstarty
- the y coordinate of the starting pointendx
- the x coordinate of the starting pointendy
- the y coordinate of the starting pointmaxLength
- the largest count of Coord points this can return; will stop early if reachedpublic static Coord[] line2D_(int startx, int starty, int endx, int endy)
startx
- the x coordinate of the starting pointstarty
- the y coordinate of the starting pointendx
- the x coordinate of the starting pointendy
- the y coordinate of the starting pointpublic static Coord[] line2D_(int startx, int starty, int endx, int endy, int maxLength)
startx
- the x coordinate of the starting pointstarty
- the y coordinate of the starting pointendx
- the x coordinate of the starting pointendy
- the y coordinate of the starting pointmaxLength
- the largest count of Coord points this can return; will stop early if reachedCopyright © Eben Howard 2012–2022. All rights reserved.