use of com.revolsys.geometry.model.impl.PointDouble in project com.revolsys.open by revolsys.
the class CoordinateTest method testEquals.
public void testEquals() {
final Point c1 = new PointDouble(1.0, 2, 3);
final String s = "Not a coordinate";
assertTrue(!c1.equals(s));
final Point c2 = new PointDouble(1.0, 2.0, 3.0);
assertTrue(c1.equals(2, c2));
final Point c3 = new PointDouble(1.0, 22.0, 3.0);
assertTrue(!c1.equals(2, c3));
}
use of com.revolsys.geometry.model.impl.PointDouble in project com.revolsys.open by revolsys.
the class CoordinateTest method testEquals2D.
public void testEquals2D() {
final Point c1 = new PointDouble(1.0, 2.0, 3.0);
final Point c2 = new PointDouble(1.0, 2.0, 3.0);
assertTrue(c1.equals(2, c2));
final Point c3 = new PointDouble(1.0, 22.0, 3.0);
assertTrue(!c1.equals(2, c3));
}
use of com.revolsys.geometry.model.impl.PointDouble in project com.revolsys.open by revolsys.
the class CoordinateTest method testGetOrdinate.
public void testGetOrdinate() {
final Point c = new PointDouble(350.2, 4566.8, 5266.3);
assertEquals(c.getCoordinate(Geometry.X), 350.2);
assertEquals(c.getCoordinate(Geometry.Y), 4566.8);
assertEquals(c.getCoordinate(Geometry.Z), 5266.3);
}
use of com.revolsys.geometry.model.impl.PointDouble in project com.revolsys.open by revolsys.
the class CoordinateTest method testDistance3D.
public void testDistance3D() {
final Point coord1 = new PointDouble(0.0, 0.0, 0.0);
final Point coord2 = new PointDouble(100.0, 200.0, 50.0);
final double distance = coord1.distance3d(coord2);
assertEquals(distance, 229.128784747792, 0.000001);
}
use of com.revolsys.geometry.model.impl.PointDouble in project com.revolsys.open by revolsys.
the class CoordinateTest method testDistance.
public void testDistance() {
final Point coord1 = new PointDouble(0.0, 0.0, 0.0);
final Point coord2 = new PointDouble(100.0, 200.0, 50.0);
final double distance = coord1.distance(coord2);
assertEquals(distance, 223.60679774997897, 0.00001);
}
Aggregations