public class Bresenham extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
line(int x1,
int y1,
int x2,
int y2,
IntCoordinateManipulator manipulator) |
static Point[] |
linePoints(int x1,
int y1,
int x2,
int y2) |
static int[] |
linePointsInt1D(int x1,
int y1,
int x2,
int y2) |
static int[][] |
linePointsInt2D(int x1,
int y1,
int x2,
int y2) |
static int |
stepCountDistance(int x1,
int y1,
int x2,
int y2)
Determines the amount of discrete steps from (x1,y1) to (x2,y2), where one step is a change of coordinates
in either straight or diagonal direction.
|
public static final int stepCountDistance(int x1,
int y1,
int x2,
int y2)
Examples:
(0,0) to (2,0) = 2 steps
(0,0) to (2,2) = 2 steps
(5,18) to (10,9) = 9 steps
x1 - the x coordinate of the first pointy1 - the y coordinate of the first pointx2 - the x coordinate of the second pointy2 - the y coordinate of the second pointpublic static final Point[] linePoints(int x1, int y1, int x2, int y2)
public static final int[] linePointsInt1D(int x1,
int y1,
int x2,
int y2)
public static final int[][] linePointsInt2D(int x1,
int y1,
int x2,
int y2)
public static final void line(int x1,
int y1,
int x2,
int y2,
IntCoordinateManipulator manipulator)
throws InvalidCoordinateException
InvalidCoordinateExceptionCopyright © 2022 MicroStream Software. All rights reserved.