1 import java.util.ArrayList;
3 import org.jdelaunay.delaunay.geometries.DEdge;
5 import com.vividsolutions.jts.geom.Coordinate;
6 import com.vividsolutions.jts.geom.LineSegment;
16 private ArrayList<Node> subNodes;
18 private Node startNode;
26 if(startNode.
getX() <= endNode.
getX()){
27 this.startNode = startNode;
28 this.endNode = endNode;
30 this.endNode = startNode;
31 this.startNode = endNode;
33 subNodes =
new ArrayList<Node>();
42 this.startNode = startNode;
43 double x = Math.cos(Math.toRadians(angleXAxis));
44 double y = -Math.sin(Math.toRadians(angleXAxis));
45 endNode =
new Node(startNode.
getX()+x, startNode.
getY()+y);
46 subNodes =
new ArrayList<Node>();
54 this(
new Node(dEdge.getStartPoint()),
new Node(dEdge.getEndPoint()));
55 subNodes =
new ArrayList<Node>();
71 this.endNode = endNode;
87 this.startNode = startNode;
112 return (node.equals(startNode) || node.equals(endNode));
120 double angle = Math.toDegrees(Math.acos(
dx()/
magnitude()));
131 return endNode.
getX()-startNode.
getX();
139 return endNode.
getY()-startNode.
getY();
147 return Math.sqrt(
dx()*
dx()+
dy()*
dy());
155 int[] subX =
new int[subNodes.size()];
156 for(
int i=0; i < subNodes.size(); i++){
157 subX[i] = subNodes.get(i).getXInt();
167 int[] subY =
new int[subNodes.size()];
168 for(
int i=0; i < subNodes.size(); i++){
169 subY[i] = subNodes.get(i).getYInt();