|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uk.ac.leeds.ccg.andyt.vector.geometry.Vector_AbstractGeometry2D uk.ac.leeds.ccg.andyt.vector.geometry.Vector_Point2D
public class Vector_Point2D
Class for points in 2D.
Field Summary | |
---|---|
java.math.BigDecimal |
_x
The x coordinate of the Vector_Point2D |
java.math.BigDecimal |
_y
The y coordinate of the Vector_Point2D |
Fields inherited from class uk.ac.leeds.ccg.andyt.vector.geometry.Vector_AbstractGeometry2D |
---|
_DecimalPlacePrecision_Integer, _RoundingMode, _Vector_Environment |
Constructor Summary | |
---|---|
Vector_Point2D()
Creates a default Vector_Point2D with: _x = null; _y = null; |
|
Vector_Point2D(java.math.BigDecimal _x,
java.math.BigDecimal _y)
this._x = new BigDecimal(_x.toString()); this._y = new BigDecimal(_y.toString()); set_DecimalPlacePrecision(Math.max(_x.scale(),_y.scale())); |
|
Vector_Point2D(java.math.BigDecimal _x,
java.math.BigDecimal _y,
java.math.BigDecimal toRoundToX_BigDecimal,
java.math.BigDecimal toRoundToY_BigDecimal)
this._x = VectorStaticBigDecimal.getRounded_BigDecimal( _x, toRoundToX_BigDecimal); this._y = VectorStaticBigDecimal.getRounded_BigDecimal( _y, toRoundToY_BigDecimal); set_DecimalPlacePrecision(toRoundTo_BigDecimal.scale()); |
|
Vector_Point2D(java.math.BigDecimal _x,
java.math.BigDecimal _y,
int _DecimalPlacePrecision)
this._x = new BigDecimal(_x.toString()); this._y = new BigDecimal(_y.toString()); set_DecimalPlacePrecision(_DecimalPlacePrecision_Integer); |
|
Vector_Point2D(double x,
double y)
Deprecated. |
|
Vector_Point2D(double x,
double y,
java.math.BigDecimal toRoundToX_BigDecimal,
java.math.BigDecimal toRoundToY_BigDecimal)
this._x = VectorStaticBigDecimal.getRounded_BigDecimal( new BigDecimal(x), toRoundToX_BigDecimal); this._y = VectorStaticBigDecimal.getRounded_BigDecimal( new BigDecimal(y), toRoundToY_BigDecimal); set_DecimalPlacePrecision( Math.max( toRoundToX_BigDecimal.scale(), toRoundToY_BigDecimal.scale())); |
|
Vector_Point2D(double x,
double y,
int _DecimalPlacePrecision)
_x = new BigDecimal(x); _y = new BigDecimal(y); set_DecimalPlacePrecision(_DecimalPlacePrecision_Integer); |
|
Vector_Point2D(java.lang.String x,
java.lang.String y)
_x = new BigDecimal(x); _y = new BigDecimal(y); set_DecimalPlacePrecision(Math.max(_x.scale(),_y.scale())); |
|
Vector_Point2D(java.lang.String x,
java.lang.String y,
int _DecimalPlacePrecision)
_x = new BigDecimal(x); _y = new BigDecimal(y); set_DecimalPlacePrecision(_DecimalPlacePrecision_Integer); |
|
Vector_Point2D(Vector_Point2D a_Point2D)
_x = new BigDecimal(aPoint2D._x.toString()); _y = new BigDecimal(aPoint2D._y.toString()); set_DecimalPlacePrecision(Math.max(_x.scale(),_y.scale())); |
|
Vector_Point2D(Vector_Point2D a_Point2D,
java.math.BigDecimal toRoundToX_BigDecimal,
java.math.BigDecimal toRoundToY_BigDecimal)
_x = new BigDecimal(a_Point2D._x.toString()); _y = new BigDecimal(a_Point2D._y.toString()); _x = VectorStaticBigDecimal.getRounded_BigDecimal( _x, toRoundToX_BigDecimal); _y = VectorStaticBigDecimal.getRounded_BigDecimal( _y, toRoundToY_BigDecimal); set_DecimalPlacePrecision( Math.max( toRoundToX_BigDecimal.scale(), toRoundToY_BigDecimal.scale())); |
|
Vector_Point2D(Vector_Point2D a_Point2D,
int _DecimalPlacePrecision)
_x = new BigDecimal(aPoint2D._x.toString()); _y = new BigDecimal(aPoint2D._y.toString()); set_DecimalPlacePrecision(_DecimalPlacePrecision_Integer); |
Method Summary | |
---|---|
void |
applyDecimalPlacePrecision()
|
int |
compareTo(java.lang.Object o)
Default is 1. |
boolean |
equals(java.lang.Object o)
|
java.math.BigDecimal |
getAngle_BigDecimal(Vector_Point2D a_Point2D)
Imprecise, but uses BigMath and BigFunction default precision |
double |
getAngle_double(Vector_Point2D a_Point2D)
Imprecise: Uses Java double precision for all calculations |
java.math.BigDecimal |
getDistance(Vector_Point2D a_VectorPoint2D,
int a_DecimalPlacePrecision)
Precise to a_DecimalPlacePrecision number of decimal places given precision of a_VectorPoint2D and this. |
Vector_Envelope2D |
getEnvelope2D()
|
java.math.BigDecimal |
getGradient(Vector_Point2D a_Point2D,
int a_DecimalPlacePrecision)
|
boolean |
getIntersects(Vector_LineSegment2D a_LineSegment2D,
int a_DecimalPlacePrecisionForCalculations)
|
int |
hashCode()
|
void |
roundTo(java.math.BigDecimal toRoundTo_BigDecimal)
|
int |
set_DecimalPlacePrecision(int _DecimalPlacePrecision)
Default method probably best overridden to determine what setting _DecimalPlacePrecision_Integer involves |
double[] |
to_doubleArray()
double[] result = new double[2]; result[0] = this._x.doubleValue(); result[1] = this._y.doubleValue(); return result; |
java.lang.String |
toString()
|
Methods inherited from class uk.ac.leeds.ccg.andyt.vector.geometry.Vector_AbstractGeometry2D |
---|
get_DecimalPlacePrecision, get_RoundingMode, getDefault_RoundingMode, getDefaultDecimalPlacePrecision_int |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public java.math.BigDecimal _x
public java.math.BigDecimal _y
Constructor Detail |
---|
public Vector_Point2D()
public Vector_Point2D(Vector_Point2D a_Point2D)
a_Point2D
- public Vector_Point2D(Vector_Point2D a_Point2D, int _DecimalPlacePrecision)
aPoint2D
- _DecimalPlacePrecision_Integer
- public Vector_Point2D(Vector_Point2D a_Point2D, java.math.BigDecimal toRoundToX_BigDecimal, java.math.BigDecimal toRoundToY_BigDecimal)
aPoint2D
- BigDecimal
- toRoundToX_BigDecimalBigDecimal
- toRoundToY_BigDecimalpublic Vector_Point2D(java.math.BigDecimal _x, java.math.BigDecimal _y)
_x
- _y
- public Vector_Point2D(java.math.BigDecimal _x, java.math.BigDecimal _y, int _DecimalPlacePrecision)
_x
- _y
- _DecimalPlacePrecision_Integer
- public Vector_Point2D(java.math.BigDecimal _x, java.math.BigDecimal _y, java.math.BigDecimal toRoundToX_BigDecimal, java.math.BigDecimal toRoundToY_BigDecimal)
_x
- _y
- BigDecimal
- toRoundToX_BigDecimalBigDecimal
- toRoundToY_BigDecimalpublic Vector_Point2D(java.lang.String x, java.lang.String y)
x
- y
- public Vector_Point2D(java.lang.String x, java.lang.String y, int _DecimalPlacePrecision)
x
- y
- _DecimalPlacePrecision_Integer
- public Vector_Point2D(double x, double y)
x
- y
- public Vector_Point2D(double x, double y, int _DecimalPlacePrecision)
x
- y
- _DecimalPlacePrecision_Integer
- public Vector_Point2D(double x, double y, java.math.BigDecimal toRoundToX_BigDecimal, java.math.BigDecimal toRoundToY_BigDecimal)
x
- y
- toRoundToX_BigDecimal
- toRoundToY_BigDecimal
- Method Detail |
---|
public int set_DecimalPlacePrecision(int _DecimalPlacePrecision)
Vector_AbstractGeometry2D
set_DecimalPlacePrecision
in class Vector_AbstractGeometry2D
public void roundTo(java.math.BigDecimal toRoundTo_BigDecimal)
public java.lang.String toString()
toString
in class Vector_AbstractGeometry2D
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
public boolean getIntersects(Vector_LineSegment2D a_LineSegment2D, int a_DecimalPlacePrecisionForCalculations)
public java.math.BigDecimal getDistance(Vector_Point2D a_VectorPoint2D, int a_DecimalPlacePrecision)
a_VectorPoint2D
- a_DecimalPlacePrecision
-
public double getAngle_double(Vector_Point2D a_Point2D)
a_Point2D
-
public java.math.BigDecimal getAngle_BigDecimal(Vector_Point2D a_Point2D)
a_Point2D
-
public java.math.BigDecimal getGradient(Vector_Point2D a_Point2D, int a_DecimalPlacePrecision)
public Vector_Envelope2D getEnvelope2D()
getEnvelope2D
in class Vector_AbstractGeometry2D
public void applyDecimalPlacePrecision()
applyDecimalPlacePrecision
in class Vector_AbstractGeometry2D
public double[] to_doubleArray()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |