use of com.revolsys.geometry.model.impl.PointDoubleXYZ in project com.revolsys.open by revolsys.
the class CoordinatesTest method testClone.
public void testClone() {
for (final Point point : //
Arrays.asList(//
new PointDoubleXY(100.0, 200.0), //
new PointDoubleXYZ(100.0, 200.0, 50.0), new PointDouble(100.0, 200.0, 50.0, 4.0))) {
final Point clone = point.newPoint();
assertEquals3d(point, clone);
}
}
use of com.revolsys.geometry.model.impl.PointDoubleXYZ in project com.revolsys.open by revolsys.
the class CoordinatesTest method testEquals2DWithinTolerance.
public void testEquals2DWithinTolerance() {
final Point c = new PointDoubleXYZ(100.0, 200.0, 50.0);
final Point aBitOff = new PointDoubleXYZ(100.1, 200.1, 50.0);
assertTrue(c.equalsVertex2d(aBitOff, 0.2));
}
use of com.revolsys.geometry.model.impl.PointDoubleXYZ in project com.revolsys.open by revolsys.
the class CoordinatesTest method testCompareTo.
public void testCompareTo() {
final Point lowest = new PointDoubleXYZ(10.0, 100.0, 50.0);
final Point highest = new PointDoubleXYZ(20.0, 100.0, 50.0);
final Point equalToHighest = new PointDoubleXYZ(20.0, 100.0, 50.0);
final Point higherStill = new PointDoubleXYZ(20.0, 200.0, 50.0);
assertEquals(-1, lowest.compareTo(highest));
assertEquals(1, highest.compareTo(lowest));
assertEquals(-1, highest.compareTo(higherStill));
assertEquals(0, highest.compareTo(equalToHighest));
}
use of com.revolsys.geometry.model.impl.PointDoubleXYZ in project com.revolsys.open by revolsys.
the class CoordinatesTest method testToString.
public void testToString() {
final String expectedResult = "POINT Z(100 200 50)";
final String actualResult = new PointDoubleXYZ(100.0, 200.0, 50.0).toString();
assertEquals(expectedResult, actualResult);
}
use of com.revolsys.geometry.model.impl.PointDoubleXYZ in project com.revolsys.open by revolsys.
the class MiscellaneousTest2 method test1.
public void test1() throws Exception {
assertTrue(this.geometryFactory.lineString(2, 0.0, 10.0, 20.0, 10.0).isOnLine(new PointDoubleXYZ(2, 10, 10)));
assertTrue(!this.geometryFactory.lineString(2, 0.0, 10.0, 20.0, 10.0).isOnLine(new PointDoubleXYZ(2, 30, 10)));
}
Aggregations