Exemplo n.º 1
0
        public Point2D inverseTransform(Point2D src, Point2D dst)
        {//throws NoninvertibleTransformException {
            double det = getDeterminant();

            if (java.lang.Math.abs(det) < ZERO)
            {
                // awt.204=Determinant is zero
                throw new NoninvertibleTransformException("Determinant is zero"); //$NON-NLS-1$
            }

            if (dst == null)
            {
                if (src is Point2D.Double)
                {
                    dst = new Point2D.Double();
                }
                else
                {
                    dst = new Point2D.Float();
                }
            }

            double x = src.getX() - m02;
            double y = src.getY() - m12;

            dst.setLocation((x * m11 - y * m01) / det, (y * m00 - x * m10) / det);
            return(dst);
        }
Exemplo n.º 2
0
 public void setCurve(Point2D p1, Point2D cp1, Point2D cp2, Point2D p2)
 {
     setCurve(
         p1.getX(), p1.getY(),
         cp1.getX(), cp1.getY(),
         cp2.getX(), cp2.getY(),
         p2.getX(), p2.getY());
 }
Exemplo n.º 3
0
 public override bool Equals(Object obj)
 {
     if (obj == this)
     {
         return(true);
     }
     if (obj is Point2D)
     {
         Point2D p = (Point2D)obj;
         return(getX() == p.getX() && getY() == p.getY());
     }
     return(false);
 }
Exemplo n.º 4
0
        public Point2D deltaTransform(Point2D src, Point2D dst)
        {
            if (dst == null)
            {
                if (src is Point2D.Double)
                {
                    dst = new Point2D.Double();
                }
                else
                {
                    dst = new Point2D.Float();
                }
            }

            double x = src.getX();
            double y = src.getY();

            dst.setLocation(x * m00 + y * m01, x * m10 + y * m11);
            return(dst);
        }
Exemplo n.º 5
0
 public void transform(Point2D[] src, int srcOff, Point2D[] dst, int dstOff, int length)
 {
     while (--length >= 0)
     {
         Point2D srcPoint = src[srcOff++];
         double  x        = srcPoint.getX();
         double  y        = srcPoint.getY();
         Point2D dstPoint = dst[dstOff];
         if (dstPoint == null)
         {
             if (srcPoint is Point2D.Double)
             {
                 dstPoint = new Point2D.Double();
             }
             else
             {
                 dstPoint = new Point2D.Float();
             }
         }
         dstPoint.setLocation(x * m00 + y * m01 + m02, x * m10 + y * m11 + m12);
         dst[dstOff++] = dstPoint;
     }
 }
Exemplo n.º 6
0
 public int relativeCCW(Point2D p)
 {
     return(relativeCCW(getX1(), getY1(), getX2(), getY2(), p.getX(), p.getY()));
 }
Exemplo n.º 7
0
 public void setLine(Point2D p1, Point2D p2)
 {
     setLine(p1.getX(), p1.getY(), p2.getX(), p2.getY());
 }
Exemplo n.º 8
0
 public bool contains(Point2D p)
 {
     return(contains(p.getX(), p.getY()));
 }
Exemplo n.º 9
0
 public void add(Point2D p)
 {
     add(p.getX(), p.getY());
 }
Exemplo n.º 10
0
 public int outcode(Point2D p)
 {
     return(outcode(p.getX(), p.getY()));
 }
Exemplo n.º 11
0
 public void setFrameFromCenter(Point2D center, Point2D corner)
 {
     setFrameFromCenter(center.getX(), center.getY(), corner.getX(), corner.getY());
 }
Exemplo n.º 12
0
 public double distanceSq(Point2D p)
 {
     return(Point2D.distanceSq(getX(), getY(), p.getX(), p.getY()));
 }
Exemplo n.º 13
0
 public void setFrame(Point2D loc, Dimension2D size)
 {
     setFrame(loc.getX(), loc.getY(), size.getWidth(), size.getHeight());
 }
Exemplo n.º 14
0
 public bool contains(Point2D point)
 {
     return(contains(point.getX(), point.getY()));
 }
Exemplo n.º 15
0
 public double ptSegDistSq(Point2D p)
 {
     return(ptSegDistSq(getX1(), getY1(), getX2(), getY2(), p.getX(), p.getY()));
 }
Exemplo n.º 16
0
 public void setLocation(Point2D p)
 {
     setLocation(p.getX(), p.getY());
 }
Exemplo n.º 17
0
 public double ptLineDist(Point2D p)
 {
     return(ptLineDist(getX1(), getY1(), getX2(), getY2(), p.getX(), p.getY()));
 }
Exemplo n.º 18
0
 public void setFrameFromDiagonal(Point2D p1, Point2D p2)
 {
     setFrameFromDiagonal(p1.getX(), p1.getY(), p2.getX(), p2.getY());
 }