public void addNode(Point point) { if (head == null) { head = new Node(point); tail = head; length += 1; } else if (head.next == null) { head.turnAngle.angle = calculateAngle(head.myPoint, point); head.next = new Node(point); tail = head.next; tail.pre = head; length += 1; } else { tail.turnAngle.angle = calculateAngle(tail.myPoint, point); tail.next = new Node(point); tail.next.pre = tail; tail = tail.next; length += 1; } }
public LinkedList(Point point) { head = new Node(point); tail = head; length = 1; distance = 40.0; iterator = head; }