edu.virginia.cs.mng.hypercast.DT
Class DT_DoublePoint
java.lang.Object
|
+--edu.virginia.cs.mng.hypercast.DT.DT_DoublePoint
- public class DT_DoublePoint
- extends java.lang.Object
This class represents a point in two dimensions, where the coordinates
of the point are doubles. It is used for increased accuracy over DT_Point.
It is immutable.
|
Field Summary |
static double |
EPSILON
The error used in the function equals() |
protected double |
x
|
protected double |
y
|
|
Method Summary |
static double |
distance(DT_DoublePoint a,
DT_DoublePoint b)
Returns the Euclidean distance between two points. |
boolean |
equals(java.lang.Object o)
Compares this to either a DT_DoublePoint or a DT_Point. |
static DT_DoublePoint |
findInterceptOfLines(double f,
double s,
double g,
double t)
Returns the point at the interception of two lines. |
double |
getX()
|
double |
getY()
|
int |
hashCode()
Override to Object.hashCode() so that this object can be used as a key in a hashtable. |
| Methods inherited from class java.lang.Object |
,
clone,
finalize,
getClass,
notify,
notifyAll,
registerNatives,
toString,
wait,
wait,
wait |
EPSILON
public static double EPSILON
- The error used in the function
equals()
x
protected double x
y
protected double y
DT_DoublePoint
public DT_DoublePoint(DT_DoublePoint p)
DT_DoublePoint
public DT_DoublePoint(DT_Point p)
DT_DoublePoint
public DT_DoublePoint(double xx,
double yy)
equals
public boolean equals(java.lang.Object o)
- Compares this to either a DT_DoublePoint or a DT_Point.
- Overrides:
- equals in class java.lang.Object
- See Also:
EPSILON
hashCode
public int hashCode()
- Override to Object.hashCode() so that this object can be used as a key in a hashtable.
- Overrides:
- hashCode in class java.lang.Object
getX
public double getX()
getY
public double getY()
distance
public static double distance(DT_DoublePoint a,
DT_DoublePoint b)
- Returns the Euclidean distance between two points.
findInterceptOfLines
public static DT_DoublePoint findInterceptOfLines(double f,
double s,
double g,
double t)
- Returns the point at the interception of two lines.
(f,s) and (g,t) are the x-intercept and slopes of two lines.
x = (g-f)/(s-t);
y = f + s*x;
- Throws:
- ArithmeticException - if s == t