Examples of Coordinates


Examples of com.googlecode.libkml.Coordinates

  public static void main(String[] args) {
    // NOTE: KmlFactory does _not_ use kmldom.
    KmlFactory factory = KmlFactory.GetFactory();

    // <coordinates>1,2</coordinates>
    Coordinates coordinates = factory.CreateCoordinates();
    coordinates.add_latlng(37.0, -122.0);

    // <Point id="pt0">...
    Point point = factory.CreatePoint();
    point.set_id("pt0");
    point.set_coordinates(coordinates);
View Full Code Here

Examples of com.ike.rwdccalc.Objects.Coordinates

    double rateOfChange = footprintWidth / 360;
    // Show some logging of the value of rateOfChange
    System.out.println("I:RWDCCalc:CalculatingTools.pathDistance: - rateOfChange is " + rateOfChange);
   
    // A and B will be used for the calculations of the distances
    Coordinates A = new Coordinates();
    Coordinates B = new Coordinates();
   
    // These ArrayLists will update every iteration with information provided
    ArrayList<String> distanceFromCenter = new ArrayList<String>();
    ArrayList<String> angleFromCenter = new ArrayList<String>();
    ArrayList<String> segmentType = new ArrayList<String>();
   
    // Only run this if there is a greater than 0 amount of iterations
    if (iterationsDouble != 0)
    for (double x = 0; x < iterationsDouble; x+=0.0041666666666666666667) {
     
      // Add the distance from center, angle from center, and segment type here
      distanceFromCenter.add(Double.toString(baseRadius - (footprintWidth * x)));
      angleFromCenter.add(Double.toString(angle * x));
      segmentType.add("P");
   
      // We will go around the circle and calculate the distance every degree around the circle
      for (double y = 0; y <= 1.5; y++) {
       
        // Set theta to whatever y is, which will be where
        // we are around the circle
        theta = y;
       
        // Let's update the radius of the flight path as the plane flys
        // around the circle in a spiral
        if (y == 0 && x == 0) {
          A.setX(baseRadius * Math.cos(Math.toRadians(theta)));
          A.setY(baseRadius * Math.sin(Math.toRadians(theta)));
          radius = baseRadius;
        } else {
          radius -= rateOfChange;
          // Let's figure out the coordinates of B
          B.setX(radius * Math.cos(Math.toRadians(theta)));
          B.setY(radius * Math.sin(Math.toRadians(theta)));
         
          // Let's find the distance between coordinate A and coordinate B
          distance = pointDistance(A.getX(), B.getX(), A.getY(), B.getY());
         
          // Let's add the distance to the totalDistance array
          totalDistance.add(new DoubleObject(distance));
         
          // Let's set B to A, and clear B, so B can be set on the next iteration
          A.clearAll();
          A.set(B);
          B.clearAll();
        }
      }
    }
   
    // Add in the distance of the outside circle that the plane will have to travel as well
View Full Code Here

Examples of com.jcabi.github.Coordinates

    @NotNull(message = "repo is never NULL")
    public Repo create(
        @NotNull(message = "json can't be NULL") final JsonObject json
    ) throws IOException {
        final String name = json.getString("name");
        final Coordinates coords = new Coordinates.Simple(this.self, name);
        this.storage.apply(
            new Directives().xpath(this.xpath()).add("repo")
                .attr("coords", coords.toString())
                .add("name").set(name).up()
                .add("description").set("test repository").up()
                .add("private").set("false").up()
        );
        final Repo repo = this.get(coords);
View Full Code Here

Examples of com.lewisd.maven.lint.model.Coordinates

            excludedCoordinates.add(Coordinates.parse(coordinate));
        }
    }

    private boolean isExcluded(final Object modelObject) {
        final Coordinates coords = modelUtil.getCoordinates(modelObject);
        for (final Coordinates excludedCoordinate : excludedCoordinates) {
            if (excludedCoordinate.matches(coords)) {
                return true;
            }
        }
View Full Code Here

Examples of edu.uci.ics.jung.visualization.Coordinates

    private Location _location = null;
   
   
    /** Creates a new instance of MapHost */
    public MapHost() {
        _coord = new Coordinates();
    }
View Full Code Here

Examples of edu.uci.ics.jung.visualization.Coordinates

        StringBuffer sb = new StringBuffer();
        Set vertices = _myGraph.getVertices();
        Set edges = _myGraph.getEdges();
        Vertex v = null;
        Edge e = null;
        Coordinates coord = null;
        Boolean hidden = null;
        Object tmp = null;
       
        sb.append("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n");
        sb.append("<mapdefinition>\n");
        // The config
        sb.append("<config>\n");
        sb.append("<view>" + name + "</view>\n");
        double scale = getVV(key).getLayoutTransformer().getScale();
        double ltranslateX = getVV(key).getLayoutTransformer().getTranslateX();
        double ltranslateY = getVV(key).getLayoutTransformer().getTranslateY();
        double vtranslateX = getVV(key).getViewTransformer().getTranslateX();
        double vtranslateY = getVV(key).getViewTransformer().getTranslateY();
        if (scale == 1.0)  {
            scale = getVV(key).getViewTransformer().getScale();
        }
        sb.append("<layouttranslatex>" + ltranslateX + "</layouttranslatex>\n");
        sb.append("<layouttranslatey>" + ltranslateY + "</layouttranslatey>\n");
        sb.append("<viewtranslatex>" + vtranslateX + "</viewtranslatex>\n");
        sb.append("<viewtranslatey>" + vtranslateY + "</viewtranslatey>\n");
        sb.append("<scale>" + scale + "</scale>\n");
        String title = getBackgroundTitle(key);
        if (title != null && title.length() > 0)  {
            sb.append("<backgroundtitle>" + title + "</backgroundtitle>\n");
        }
        String bgImage = getBackground(key);
        if (bgImage != null && bgImage.length() > 0)
            sb.append("<backgroundimage>"+ bgImage +"</backgroundimage>\n");
        sb.append("</config>\n");
        // The hosts
        if (!vertices.isEmpty()) {
            sb.append("<hosts>\n");
            for (Object o: vertices) {
                if (o != null && o instanceof Vertex) {
                    v = (Vertex)o;
                    coord = getLayout(key).getCoordinates(v);
                    hidden = (Boolean)v.getUserDatum(userdatumkey+key);
                    sb.append("<host");
                    if (hidden != null && hidden.booleanValue()) {
                        sb.append(" hidden=\"true\"");
                    } if (isLocked(v, key)) {
                        sb.append(" locked=\"true\"");
                    }
                    sb.append(">\n");
                    sb.append("<name>" + getLabel(v) + "</name>\n");
                    sb.append("<coords>" + coord.getX() + "," + coord.getY() + "</coords>\n");
                    tmp = v.getUserDatum("labelLocation");
                    if (tmp != null && tmp instanceof Location) {
                        sb.append("<label_location>" + ((Location)tmp).toString() + "</label_location>\n");
                        tmp = null;
                    }
View Full Code Here

Examples of edu.uci.ics.jung.visualization.Coordinates

            Point2D p = l.getLocation(v);
           
            while (it.hasNext()) {
                v = (Vertex)it.next();
                if (loc == Location.Top) {
                    moveVertex(v, new Coordinates(l.getLocation(v).getX(), p.getY()), key);
                } else if (loc == Location.Left) {
                    moveVertex(v, new Coordinates(p.getX(), l.getLocation(v).getY()), key);
                }
            }
        }
    }
View Full Code Here

Examples of edu.uci.ics.jung.visualization.Coordinates

            if (o instanceof Vertex) {
               
                v = (Vertex)o;
                if (isLocked(v))
                    continue;
                Coordinates coord = getCoordinates(v);
               
                junk = v.getUserDatum("level");
                if (junk instanceof Integer) {
                    lvl = (double)((Integer)junk).intValue();
                }
                if (lvl != nivelVisitado)
                    continue;
               
                double my_lvl_radius = radius / nivelVisitado;
                //double my_lvl_radius = radius * angles[(int)lvl-((int)lvl > 0?1:0)];
               
                double angle = (2 * Math.PI * i++) / angles[(int)lvl-((int)lvl > 0?1:0)];
               
                double cosX = Math.cos(angle);
                double sinY = Math.sin(angle);
                double xradius = (my_lvl_radius + (width/3 * (lvl / level_num)));
                double yradius = (my_lvl_radius + (width/3 * (lvl / level_num)));

    
     if (coord.getX() == 0d || coord.getY() == 0d)  {
         System.out.println("Oops... alguna coordenada es 0");
     }

     // test
                LinkedList parents = (LinkedList)v.getUserDatum("parents");
                Vertex parent = null;
                if (parents != null) {
                 parent = (Vertex)parents.getFirst();
                 if (parent != null) {
                     Coordinates pcoords = getCoordinates(parent);
                     if (pcoords.getX() == 0 || pcoords.getY() == 0) {
                         continue;
                     }
                    
     coord.setX(cosX * xradius + pcoords.getX());
     coord.setY(sinY * yradius + pcoords.getY());
     if (true)
                    continue;

                     double normaParent = Math.hypot(pcoords.getX(), pcoords.getY());
                     double normaYo = Math.hypot(coord.getX(), coord.getY());
                     System.out.println("normaParent: " + normaParent + "   normaYo: " + normaYo);
                     double porcent = 0;
                     if (normaParent > normaYo) {
                         porcent = normaParent / normaYo;
                         coord.setX(coord.getX() * porcent);
                         coord.setY(coord.getY() * porcent);
                     } else  {
                         porcent = normaYo / normaParent;
                         coord.setX(pcoords.getX() * porcent);
                         coord.setY(pcoords.getY() * porcent);
                     }
               }
          if (coord.getX() == 0d || coord.getY() == 0d)  {
         System.out.println("Oops... despues ... alguna coordenada es 0");
     }
View Full Code Here

Examples of edu.uci.ics.jung.visualization.Coordinates

            if (o instanceof Vertex) {
                cuantos++;
                v = (Vertex)o;
                if (isLocked(v))
                    continue;
                Coordinates coord = getCoordinates(v);
               
                junk = v.getUserDatum("level");
                if (junk instanceof Integer) {
                    lvl = (double)((Integer)junk).intValue();
                }
                if (lvl != nivelVisitado)
                    continue;
                // calcular el angulo segun la cantidad de Vertices
                // en este nivel vCant
                // level_num cantidad de niveles
                //double angle = (2 * Math.PI * angles[(int)lvl-((int)lvl > 0?1:0)]++) / angles[(int)lvl-((int)lvl > 0?1:0)];
                //double angle = (2 * Math.PI * angles[(int)lvl-((int)lvl > 0?1:0)]++) / (vertices.size() / level_num);
// funca                double angle = (Math.PI * angles[(int)lvl-((int)lvl > 0?1:0)]++) / (double)(vertices.size() / level_num) ;
                // calcular el x,y segun la cantidad de niveles
//                coord.setX(Math.cos(angle) * (width / 2) + (radius * (lvl / level_num)));
//                coord.setY(Math.sin(angle) * (height / 2)  + (radius * (lvl / level_num)));
//coord.setX(Math.cos(angle) * radius + width / 2);
//coord.setY(Math.sin(angle) * radius + height / 2);
    
               

double angle = (2 * Math.PI * i++) / vCant;

               
                double cosX = Math.cos(angle);
                double sinY = Math.sin(angle);
                double xradius = (radius + (width * (lvl / level_num)));
                double yradius = (radius + (width * (lvl / level_num)));

     coord.setX(cosX * xradius + (width / 2));
     coord.setY(sinY * yradius + (height / 2));
    
     if (coord.getX() == 0d || coord.getY() == 0d)  {
         System.out.println("Oops... alguna coordenada es 0");
     }


     // test
                LinkedList parents = (LinkedList)v.getUserDatum("parents");
                Vertex parent = null;
                if (parents != null) {
                 parent = (Vertex)parents.getFirst();
                 if (parent != null) {
                     Coordinates pcoords = getCoordinates(parent);
                     if (pcoords.getX() == 0 || pcoords.getY() == 0) {
                         continue;
                     }
                     double normaParent = Math.hypot(pcoords.getX(), pcoords.getY());
                     double normaYo = Math.hypot(coord.getX(), coord.getY());
                     System.out.println("normaParent: " + normaParent + "   normaYo: " + normaYo);
                     double porcent = 0;
                     if (normaParent > normaYo) {
                         porcent = normaParent / normaYo;
                         coord.setX(coord.getX() * porcent);
                         coord.setY(coord.getY() * porcent);
                     } else  {
                         porcent = normaYo / normaParent;
                         coord.setX(pcoords.getX() * porcent);
                         coord.setY(pcoords.getY() * porcent);
                     }
               }
          if (coord.getX() == 0d || coord.getY() == 0d)  {
         System.out.println("Oops... despues ... alguna coordenada es 0");
     }
View Full Code Here

Examples of gt.geolocation.w3c.Coordinates

          double latitude = Double.parseDouble(x);
          x = stTok.nextToken().substring(1);
          x = x.substring(0, x.length()-1);
          double longitude = Double.parseDouble(x);
         
          Coordinates coords = new Coordinates(latitude, longitude, new Double(0), 0, new Double(0), null, new Double(0));
          Position pos = new Position(coords, -1);
          return pos;
        } else {
          return null;
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.