Search in sources :

Example 16 with PointDoubleXYZ

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));
}
Also used : PointDoubleXYZ(com.revolsys.geometry.model.impl.PointDoubleXYZ) Point(com.revolsys.geometry.model.Point)

Example 17 with PointDoubleXYZ

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);
}
Also used : PointDoubleXYZ(com.revolsys.geometry.model.impl.PointDoubleXYZ) Point(com.revolsys.geometry.model.Point)

Example 18 with PointDoubleXYZ

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);
}
Also used : PointDoubleXYZ(com.revolsys.geometry.model.impl.PointDoubleXYZ) Point(com.revolsys.geometry.model.Point)

Example 19 with PointDoubleXYZ

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);
}
Also used : PointDoubleXYZ(com.revolsys.geometry.model.impl.PointDoubleXYZ) Point(com.revolsys.geometry.model.Point)

Example 20 with PointDoubleXYZ

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);
}
Also used : PointDoubleXYZ(com.revolsys.geometry.model.impl.PointDoubleXYZ) Point(com.revolsys.geometry.model.Point)

Aggregations

PointDoubleXYZ (com.revolsys.geometry.model.impl.PointDoubleXYZ)20 Point (com.revolsys.geometry.model.Point)17 PointDoubleXY (com.revolsys.geometry.model.impl.PointDoubleXY)4 Geometry (com.revolsys.geometry.model.Geometry)2 Record (com.revolsys.record.Record)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 BPlusTreeMap (com.revolsys.collection.bplus.BPlusTreeMap)1 IntHashMap (com.revolsys.collection.map.IntHashMap)1 LengthIndexedLine (com.revolsys.geometry.linearref.LengthIndexedLine)1 GeometryFactory (com.revolsys.geometry.model.GeometryFactory)1 LineString (com.revolsys.geometry.model.LineString)1 Triangle (com.revolsys.geometry.model.Triangle)1 CoordinatesDistanceComparator (com.revolsys.geometry.model.coordinates.comparator.CoordinatesDistanceComparator)1 LineStringDouble (com.revolsys.geometry.model.impl.LineStringDouble)1 PointDouble (com.revolsys.geometry.model.impl.PointDouble)1 LineSegment (com.revolsys.geometry.model.segment.LineSegment)1 LineSegmentDoubleGF (com.revolsys.geometry.model.segment.LineSegmentDoubleGF)1 List (java.util.List)1 Map (java.util.Map)1