use of com.revolsys.geometry.model.impl.PointDoubleXYZ in project com.revolsys.open by revolsys.
the class CoordinatesTest method testEquals3D.
public void testEquals3D() {
final Point c1 = new PointDoubleXYZ(1.0, 2.0, 3.0);
final Point c2 = new PointDoubleXYZ(1.0, 2.0, 3.0);
assertTrue(c1.equals(3, c2));
final Point c3 = new PointDoubleXYZ(1.0, 22.0, 3.0);
assertTrue(!c1.equals(3, c3));
}
use of com.revolsys.geometry.model.impl.PointDoubleXYZ in project com.revolsys.open by revolsys.
the class CoordinatesTest method testConstructor3D.
public void testConstructor3D() {
final Point c = new PointDoubleXYZ(350.2, 4566.8, 5266.3);
assertEquals(c, 350.2, 4566.8, 5266.3);
}
use of com.revolsys.geometry.model.impl.PointDoubleXYZ in project com.revolsys.open by revolsys.
the class CoordinatesTest method testDistance.
public void testDistance() {
final Point coord1 = new PointDoubleXYZ(0.0, 0.0, 0.0);
final Point coord2 = new PointDoubleXYZ(100.0, 200.0, 50.0);
final double distance = coord1.distancePoint(coord2);
assertEquals(distance, 223.60679774997897, 0.00001);
}
use of com.revolsys.geometry.model.impl.PointDoubleXYZ in project com.revolsys.open by revolsys.
the class CoordinatesTest method testGetOrdinate.
public void testGetOrdinate() {
final Point c = new PointDoubleXYZ(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.PointDoubleXYZ in project com.revolsys.open by revolsys.
the class CoordinatesTest method testDistance3D.
public void testDistance3D() {
final Point coord1 = new PointDoubleXYZ(0.0, 0.0, 0.0);
final Point coord2 = new PointDoubleXYZ(100.0, 200.0, 50.0);
final double distance = coord1.distance3d(coord2);
assertEquals(distance, 229.128784747792, 0.000001);
}
Aggregations