public class CanvasUtil
extends java.lang.Object
Constructor and Description |
---|
CanvasUtil() |
Modifier and Type | Method and Description |
---|---|
static double |
distance(double[] a,
double[] b)
Calculates the distance between two points
|
static double[][] |
getCorners(Paint paint,
double x1,
double x2,
double y1,
double y2)
Takes a pair of coordinates and returns a pair of coordinates matching the same square where the first coordinate pair
is the top left corner and the second is the bottom right, and the box does not extend past the edge of the canvas
|
static int[][] |
getCorners(Paint paint,
int x1,
int x2,
int y1,
int y2)
An integer wrapper for the
getCorners function |
public static int[][] getCorners(Paint paint, int x1, int x2, int y1, int y2)
getCorners
functionpaint
- the main JavaFX class of the programx1
- the first x-coordinatex2
- the second x-coordinatey1
- the first y-coordinatey2
- the second y-coordinatepublic static double[][] getCorners(Paint paint, double x1, double x2, double y1, double y2)
paint
- the main JavaFX class of the programx1
- the first x-coordinatex2
- the second x-coordinatey1
- the first y-coordinatey2
- the second y-coordinatepublic static double distance(double[] a, double[] b)
a
- the coordinate pairb
- the second coordinate pair