use of com.revolsys.geometry.model.util.TriangleImpl in project com.revolsys.open by revolsys.
the class TriangleTest method checkLongestSideLength.
public void checkLongestSideLength(final String wkt, final double expectedValue) throws Exception {
final Geometry g = this.geometryFactory.geometry(wkt);
final TriangleImpl t = newTriangle(g);
double length = Triangles.longestSideLength(t.p0, t.p1, t.p2);
// System.out.println("(Static) longestSideLength = " + length);
assertEquals(expectedValue, length, 0.00000001);
// Test Instance version
//
length = t.longestSideLength();
// System.out.println("(Instance) longestSideLength = " + length);
assertEquals(expectedValue, length, 0.00000001);
}
use of com.revolsys.geometry.model.util.TriangleImpl in project com.revolsys.open by revolsys.
the class TriangleTest method checkAcute.
public void checkAcute(final String wkt, final boolean expectedValue) throws Exception {
final Polygon g = (Polygon) this.geometryFactory.geometry(wkt);
final TriangleImpl t = newTriangle(g);
final boolean isAcute = t.isAcute();
// System.out.println("isAcute = " + isAcute);
assertEquals(expectedValue, isAcute);
}
use of com.revolsys.geometry.model.util.TriangleImpl in project com.revolsys.open by revolsys.
the class TriangleTest method checkCircumCentre.
public void checkCircumCentre(final String wkt, final Point expectedValue) throws Exception {
final Geometry g = this.geometryFactory.geometry(wkt);
final TriangleImpl t = newTriangle(g);
Point circumcentre = Triangles.circumcentre(t.p0, t.p1, t.p2);
// System.out.println("(Static) circumcentre = " + circumcentre);
assertEquals(expectedValue.toString(), circumcentre.toString());
// Test Instance version
//
circumcentre = t.circumcentre();
// System.out.println("(Instance) circumcentre = " +
// circumcentre.toString());
assertEquals(expectedValue.toString(), circumcentre.toString());
}
use of com.revolsys.geometry.model.util.TriangleImpl in project com.revolsys.open by revolsys.
the class TriangleTest method checkCentroid.
public void checkCentroid(final String wkt, final Point expectedValue) throws Exception {
final Geometry g = this.geometryFactory.geometry(wkt);
final TriangleImpl t = newTriangle(g);
Point centroid = Triangles.centroid(t.p0, t.p1, t.p2);
// System.out.println("(Static) centroid = " + centroid);
assertEquals(expectedValue.toString(), centroid.toString());
// Test Instance version
//
centroid = t.centroid();
// System.out.println("(Instance) centroid = " + centroid.toString());
assertEquals(expectedValue.toString(), centroid.toString());
}
use of com.revolsys.geometry.model.util.TriangleImpl in project com.revolsys.open by revolsys.
the class TriangleTest method newTriangle.
public TriangleImpl newTriangle(final Polygon g) {
final LineString line = g.getShell();
final TriangleImpl t = newTriangle(line);
return t;
}
Aggregations