public class Points extends Object
Constructor and Description |
---|
Points() |
Modifier and Type | Method and Description |
---|---|
static int |
distance(int x1,
int y1,
int x2,
int y2)
Returns the Euclidian distance between the specified two points, truncated to the nearest
integer.
|
static int |
distanceSq(int x1,
int y1,
int x2,
int y2)
Returns the squared Euclidian distance between the specified two points.
|
static int |
manhattanDistance(int x1,
int y1,
int x2,
int y2)
Returns the Manhattan distance between the specified two points.
|
static String |
pointToString(int x,
int y)
Returns a string describing the supplied point, of the form
+x+y , +x-y ,
-x-y , etc. |
public static int distanceSq(int x1, int y1, int x2, int y2)
public static int distance(int x1, int y1, int x2, int y2)
public static int manhattanDistance(int x1, int y1, int x2, int y2)
public static String pointToString(int x, int y)
+x+y
, +x-y
,
-x-y
, etc.Copyright © 2017. All rights reserved.