## ConvexHull by brute force

I'm working on a convex hull problem. I want to use brute force O(n^3).

I've got some code done and it works okay but instead of outputting the convex hull I get edges to every point. Can someone help me out here. I'm dying.

Java Code:
```import java.util.*;
import java.awt.Point;
import java.awt.Polygon;

public class ConvexHull {
// all the points in the collection
private ArrayList<Point> points;

// the polygon that makes up the convex hull
private Polygon hull;

// a boolean to check if the convex hull needs to be recalculated
private boolean hullCalculated = false;

// constructor
public ConvexHull() {
points = new ArrayList<Point>();
hull = new Polygon();
}

/**
* Adds a single point to the collection
* @param point
*/
hullCalculated = false;
}

/** returns a specific point from the collection
*
* @param i: a number between 0 and the number of points
* @return the Point indexed
*/
public Point getPoint(int i){
if (0 <= i && i < points.size())
return points.get(i);
else
throw new NoSuchElementException();
}

/**
*
* @return an ArrayList with all the Points in the collection
*/
public ArrayList<Point> getPoints() {
return points;
}

/**
* removes all the points from the collection
*/
public void clear() {
points.clear();
hull.reset();
hullCalculated = false;
}

/** returns the number of points in the current collection */
public int getNumber() {
return points.size();
}

/** returns the convex hull for the current set of points */
public Polygon getHull() {
if (!hullCalculated)
calculateConvexHull();
return hull;
}

/** returns all points' positions as a String */
public String toString() {
String returnString = "Points:\n";
for (int i=0; i<hull.npoints; i++){
returnString = returnString + " Point " + i + ": (" +
points.get(i).x + "," + points.get(i).y;
}
return returnString;
}

/** returns convex hull points */
public String convexHullToString() {
String hullPoints = "Convex Hull:\n";
if (!hullCalculated)
calculateConvexHull();
for (int i=0; i<hull.npoints; i++){
hullPoints = hullPoints + "\t(" + hull.xpoints[i] +","
+ hull.ypoints[i] + ")\n";
}
return hullPoints;
}

/**
* Calculates the convex hull from the current set of points
*
* This method currently does not work!
*/
private void calculateConvexHull() {
hull.reset();
hullCalculated = true;
Point leftMost = null;
int i = 0, j, k;

if (points.get(i).x > points.get(i + 1).x){
leftMost = points.get(i + 1);
Point nextLeft = points.get(i + 2);
i++;

for (j = 0; j < points.size(); j++){
Edge chkEdge = new Edge(leftMost, nextLeft);

for (k = 0; k < points.size(); k++){
chkEdge.plugInPoint(points.get(k));

//do the sign check.
// if all neg or all pos then this is an edge
if (j != k){
chkEdge.plugInPoint(points.get(j));