|
||||||||||
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_LineSegment2D
public class Vector_LineSegment2D
Class for a line segment in 2D represented by two Point2D instances, one is designated a start point and the other an end point. In this way a line segment explicitly has a direction. Two Vector_LineSegment2D instances are regarded as equal iff their start and end points are the same.
Field Summary | |
---|---|
Vector_Point2D |
_End_Point2D
|
Vector_Point2D |
_Start_Point2D
|
Fields inherited from class uk.ac.leeds.ccg.andyt.vector.geometry.Vector_AbstractGeometry2D |
---|
_DecimalPlacePrecision_Integer, _RoundingMode, _Vector_Environment |
Constructor Summary | |
---|---|
Vector_LineSegment2D()
Creates a default Vector_LineSegment2D with: _Start_Point2D = null; _End_Point2D = null; |
|
Vector_LineSegment2D(Vector_LineSegment2D a_LineSegment2D)
Creates a Vector_LineSegment2D with: this._Start_Point2D = new Point2D(a_LineSegment2D._Start_Point2D); this._End_Point2D = new Point2D(a_LineSegment2D._End_Point2D); this._DecimalPlacePrecision_Integer = a_LineSegment2D._DecimalPlacePrecision_Integer; |
|
Vector_LineSegment2D(Vector_Point2D _StartPoint,
Vector_Point2D _EndPoint)
Creates a Vector_LineSegment2D with: this._Start_Point2D = new Point2D(_StartPoint); this._End_Point2D = new Point2D(_EndPoint); set_DecimalPlacePrecision(Math.max( _Start_Point2D.get_DecimalPlacePrecision(), _End_Point2D.get_DecimalPlacePrecision())); |
|
Vector_LineSegment2D(Vector_Point2D _StartPoint,
Vector_Point2D _EndPoint,
int _DecimalPlacePrecision)
Creates a Vector_LineSegment2D with: _StartPoint = _StartPoint; _EndPoint = _EndPoint; _DecimalPlacePrecision_Integer = _DecimalPlacePrecision_Integer; _RoundingMode = _RoundingMode. |
Method Summary | |
---|---|
void |
applyDecimalPlacePrecision()
|
int |
compareTo(java.lang.Object o)
Default is 1. |
double |
getAngleToX_double()
|
double |
getAngleToY_double()
|
java.math.BigDecimal |
getCrossProduct(Vector_LineSegment2D a_LineSegment2D)
Assuming a_LineSegment.StartPoint == this. |
Vector_Envelope2D |
getEnvelope2D()
|
protected java.math.BigDecimal |
getGradient(int a_DecimalPlacePrecision)
|
Vector_AbstractGeometry2D |
getIntersection(Vector_LineSegment2D a_LineSegment2D,
int a_DecimalPlacePrecision)
Intersection method adapted from http://local.wasp.uwa.edu.au/~pbourke/geometry/lineline2d/ |
boolean |
getIntersects(Vector_LineSegment2D a_LineSegment2D,
boolean ignore_this_Start_Point2D,
int a_DecimalPlacePrecision)
For optimisation reasons, intersection done by first seeing if there is Envelope intersection... |
boolean |
getIntersects(Vector_LineSegment2D a_LineSegment2D,
int a_DecimalPlacePrecision)
Intersection done by first seeing if Envelope intersection.... |
boolean |
getIntersects(Vector_Point2D a_Point2D,
int a_DecimalPlacePrecision)
Intersection done by calculating angle or gradient of the line and comparing this with that of a_Point. |
java.math.BigDecimal |
getLength(int a_DecimalPlacePrecision)
|
Vector_LineSegment2D |
getOrderedLineSegment2D()
|
java.math.BigDecimal |
getScalarProduct(Vector_LineSegment2D a_LineSegment2D)
Assuming a_LineSegment.StartPoint == this. |
protected boolean |
isOnGradient(Vector_Point2D a_Point2D,
int a_DecimalPlacePrecision)
|
int |
set_DecimalPlacePrecision(int _DecimalPlacePrecision)
Default method probably best overridden to determine what setting _DecimalPlacePrecision_Integer involves |
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, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public Vector_Point2D _Start_Point2D
public Vector_Point2D _End_Point2D
Constructor Detail |
---|
public Vector_LineSegment2D()
public Vector_LineSegment2D(Vector_Point2D _StartPoint, Vector_Point2D _EndPoint)
_StartPoint
- _EndPoint
- public Vector_LineSegment2D(Vector_Point2D _StartPoint, Vector_Point2D _EndPoint, int _DecimalPlacePrecision)
_StartPoint
- _EndPoint
- _DecimalPlacePrecision_Integer
- _RoundingMode
- public Vector_LineSegment2D(Vector_LineSegment2D a_LineSegment2D)
_StartPoint
- _EndPoint
- Method Detail |
---|
public int set_DecimalPlacePrecision(int _DecimalPlacePrecision)
Vector_AbstractGeometry2D
set_DecimalPlacePrecision
in class Vector_AbstractGeometry2D
public java.lang.String toString()
toString
in class Vector_AbstractGeometry2D
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
public java.math.BigDecimal getLength(int a_DecimalPlacePrecision)
a_DecimalPlacePrecision
-
public Vector_Envelope2D getEnvelope2D()
getEnvelope2D
in class Vector_AbstractGeometry2D
public boolean getIntersects(Vector_LineSegment2D a_LineSegment2D, int a_DecimalPlacePrecision)
a_LineSegment2D
-
public boolean getIntersects(Vector_LineSegment2D a_LineSegment2D, boolean ignore_this_Start_Point2D, int a_DecimalPlacePrecision)
a_LineSegment2D
- ignore_this_Start_Point2D
- if true then if
this._Start_Point2D.getIntersects(a_LineSegment2D) return false
public boolean getIntersects(Vector_Point2D a_Point2D, int a_DecimalPlacePrecision)
a_Point2D
-
protected java.math.BigDecimal getGradient(int a_DecimalPlacePrecision)
protected boolean isOnGradient(Vector_Point2D a_Point2D, int a_DecimalPlacePrecision)
public Vector_LineSegment2D getOrderedLineSegment2D()
public Vector_AbstractGeometry2D getIntersection(Vector_LineSegment2D a_LineSegment2D, int a_DecimalPlacePrecision)
public double getAngleToX_double()
public double getAngleToY_double()
public java.math.BigDecimal getScalarProduct(Vector_LineSegment2D a_LineSegment2D)
a_LineSegment2D
-
public java.math.BigDecimal getCrossProduct(Vector_LineSegment2D a_LineSegment2D)
a_LineSegment2D
-
public void applyDecimalPlacePrecision()
applyDecimalPlacePrecision
in class Vector_AbstractGeometry2D
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |