Package org.osm2world.core.math

Examples of org.osm2world.core.math.VectorXZ


   * TODO describe effect of incident triangles
   */
  public List<TriangleXZ> getVoronoiCellSectors(VectorXYZ point,
      Collection<DelaunayTriangle> incidentTriangles) {
   
    final VectorXZ pointXZ = point.xz();
   
    /* build sorted list of triangles
     * by starting at any incidentTriangle and going left and right
     * around the point, appending neighbors. */
   
 
View Full Code Here


   
    assertFalse(waterAreas.isEmpty());
   
    for (LatLon landSite : landSites) {
     
      VectorXZ v = mapProjection.calcPos(landSite);
     
      for (MapArea waterArea : waterAreas) {
        assertFalse(waterArea.getPolygon().contains(v));
      }
     
    }
   
    for (LatLon waterSite : waterSites) {
     
      VectorXZ v = mapProjection.calcPos(waterSite);
     
      boolean isWater = false;
     
      for (MapArea waterArea : waterAreas) {
        if (waterArea.getPolygon().contains(v)) {
View Full Code Here

    terrainPointGrid = new TerrainPoint[numPointsX][numPointsZ];

    for (int x = 0; x < numPointsX; x++) {
      for (int z = 0; z < numPointsZ; z++) {

        VectorXZ pos = new VectorXZ(boundary.minX + x * boundary.sizeX()
            / (numPointsX - 1), boundary.minZ + z * boundary.sizeZ()
            / (numPointsZ - 1));

        TerrainPoint terrainPoint = new TerrainPoint(pos,
            getElevation(pos));
View Full Code Here

      this.setNeighbor(indexOfNeighbor(oldNeighbor), newNeighbor);
    }
   
    public double angleAt(int pointIndex) {
     
      VectorXZ vecToNext = getPoint(pointIndex).xz().subtract(
          getPoint((pointIndex + 2) % 3).xz());
      VectorXZ vecToPrev = getPoint((pointIndex + 1) % 3).xz().subtract(
          getPoint(pointIndex).xz()).invert();
     
      return VectorXZ.angleBetween(vecToNext, vecToPrev);
     
    }
View Full Code Here

     
    }
   
    public VectorXZ getCircumcircleCenter() {
     
      VectorXZ b = p1.subtract(p0).xz();
      VectorXZ c = p2.subtract(p0).xz();

      double d = 2 * (b.x * c.z - b.z * c.x);

      double rX = (c.z * (b.x * b.x + b.z * b.z) - b.z * (c.x * c.x + c.z * c.z)) / d;
      double rZ = (b.x * (c.x * c.x + c.z * c.z) - c.x * (b.x * b.x + b.z * b.z)) / d;
     
      return new VectorXZ(rX, rZ).add(p0.xz());
     
    }
View Full Code Here

   
    OrthographicAzimuthalMapProjection proj =
        new OrthographicAzimuthalMapProjection();
    proj.setOrigin(new LatLon(0, 0));
   
    VectorXZ posOrigin = proj.calcPos(0, 0);
    assertAlmostEquals(0, posOrigin.x);
    assertAlmostEquals(0, posOrigin.z);
    assertAlmostEquals(0, proj.calcLat(posOrigin));
    assertAlmostEquals(0, proj.calcLon(posOrigin));
   
    VectorXZ posE = proj.calcPos(0, 0.000009);
    assertAlmostEquals(1, posE.x);
    assertAlmostEquals(0, posE.z);
    assertAlmostEquals(0, proj.calcLat(posE));
    assertAlmostEquals(0.000009, proj.calcLon(posE));

    VectorXZ posN = proj.calcPos(0.000009, 0);
    assertAlmostEquals(0, posN.x);
    assertAlmostEquals(1, posN.z);
    assertAlmostEquals(0.000009, proj.calcLat(posN));
    assertAlmostEquals(0, proj.calcLon(posN));
   
View Full Code Here

   
  @Test
  public void testFindVisibleOutlineVertex1() {
   
    assertNotNull(EarClippingTriangulationUtil.findVisibleOutlineVertex(
            outlineA, new VectorXZ(0.55f, 0.55f),
            Collections.<SimplePolygonXZ>emptyList()));
       
  }
View Full Code Here

  @Test
  public void testFindVisibleOutlineVertex2() {
   
    assertEquals(outlineA2, outlineA.get(
        EarClippingTriangulationUtil.findVisibleOutlineVertex(
            outlineA, new VectorXZ(0.55f, 0.55f),
            Arrays.asList(holeA))));

  }
View Full Code Here

  @Test
  public void testFindVisibleOutlineVertex3() {
   
    assertNull(
        EarClippingTriangulationUtil.findVisibleOutlineVertex(
            outlineA, new VectorXZ(0.55f, 0.55f),
            Arrays.asList(holeA, holeB)));
       
  }
View Full Code Here

   
      TriangleXYZWithNormals triangle = itr1.next();
      VectorXYZ n1 = triangle.n1;
      VectorXYZ n2 = triangle.n2;
      VectorXYZ n3 = triangle.n3;
      VectorXZ tex1 = itr2.next();
      VectorXZ tex2 = itr2.next();
      VectorXZ tex3 = itr2.next();
     
      append(INDENT);
   
      if (depth > 0) {
     
View Full Code Here

TOP

Related Classes of org.osm2world.core.math.VectorXZ

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.