Package chunmap.model.coord

Examples of chunmap.model.coord.Coordinate2D


    if (this.isVertical() && l2.isVertical()) {
      return null;
    } else if (this.isVertical()) {
      double y = l2.getY(this.b);
      return new Coordinate2D(this.b, y);
    } else if (l2.isVertical()) {
      double y = this.getY(l2.b);
      return new Coordinate2D(l2.b, y);
    } else if (k1 == k2) {
      return null;// 平行
    } else if (k1 == 0) {
      double x = l2.getX(this.b);
      return new Coordinate2D(x, this.b);
    } else if (k2 == 0) {
      double x = this.getX(l2.b);
      return new Coordinate2D(x, l2.b);
    }

    double x = (b1 - b2) / (k2 - k1);
    double y = this.getY(x);

    return new Coordinate2D(x, y);
  }
View Full Code Here


  public double getMinY() {
    return minY;
  }

  public CPoint getMinPoint() {
    return new Coordinate2D(minX, minY);
  }
View Full Code Here

  public CPoint getMinPoint() {
    return new Coordinate2D(minX, minY);
  }

  public CPoint getMaxPoint() {
    return new Coordinate2D(maxX, maxY);
  }
View Full Code Here

    return new Coordinate2D(maxX, maxY);
  }
 
  public CPoint leftUp()
    {
        return new Coordinate2D(minX, maxY);
    }
View Full Code Here

    {
        return new Coordinate2D(minX, maxY);
    }
    public CPoint rightDown()
    {
        return new Coordinate2D(maxX, minY);
    }
View Full Code Here

   * @return
   */
  public CPoint getCenter() {
    double x = (minX + maxX) / 2d;
    double y = (minY + maxY) / 2d;
    return new Coordinate2D(x, y);
  }
View Full Code Here

    return pg;
  }
 
  public Ring toRing() {
    List<CPoint> points = new ArrayList<CPoint>();
    CPoint p1 = new Coordinate2D(minX, minY);
    CPoint p2 = new Coordinate2D(maxX, minY);
    CPoint p3 = new Coordinate2D(maxX, maxY);
    CPoint p4 = new Coordinate2D(minX, maxY);
    points.add(p1);
    points.add(p2);
    points.add(p3);
    points.add(p4);
    points.add(p1);
View Full Code Here

  public ArrowSymbol(Color color,int w,int h) {
    this.color = color;
   
    List<CPoint> points = new ArrayList<CPoint>();
    CPoint p1 = new Coordinate2D(-w, h);
    CPoint p2 = new Coordinate2D(0, 0);
    CPoint p3 = new Coordinate2D(-w, -h);
    points.add(p1);
    points.add(p2);
    points.add(p3);

    LineString ls = new LineString(points);
View Full Code Here

  }

  private Geometry getGeometry(CPoint p1, CPoint p2) {

    Vector v1 = new Vector(p1, p2);
    Vector v2 = new Vector(new Coordinate2D(0, 0), new Coordinate2D(0, 1));
    double angle = v1.computeAngle(v2);
    AffineTransform transf = AffineTransform.rotate(0, 0, angle + Math.PI
        / 2d);
    AffineTransform transf2 = transf.accumulate(AffineTransform.pan(p2
        .getX(), p2.getY()));
View Full Code Here

    return new Vector(x, y, z);
  }

  public double computeAngle(Vector v2) {
    CPoint p = new Coordinate2D(0, 0);
    Angle angle = new Angle(point, p, v2.point);
    return angle.computeAngle();
  }
View Full Code Here

TOP

Related Classes of chunmap.model.coord.Coordinate2D

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.