Rectangle
edu.jas.root

Class Rectangle<C extends RingElem<C> & Rational>

    • Constructor Detail

      • Rectangle

        public Rectangle(Complex<C> mid)
        Constructor.
        Parameters:
        mid - corner.
      • Rectangle

        public Rectangle(Complex<C> sw,         Complex<C> ne)
        Constructor.
        Parameters:
        sw - corner.
        ne - corner.
      • Rectangle

        public Rectangle(Complex<C> nw,         Complex<C> sw,         Complex<C> se,         Complex<C> ne)
        Constructor.
          nw|0 ne|3  sw|1 se|2 
        Parameters:
        nw - corner.
        sw - corner.
        se - corner.
        ne - corner.
    • Method Detail

      • toScript

        public String toScript()
        Get a scripting compatible string representation.
        Returns:
        script compatible representation for this Rectangle.
      • getNW

        public Complex<C> getNW()
        Get north west corner.
        Returns:
        north west corner of this rectangle.
      • getSW

        public Complex<C> getSW()
        Get south west corner.
        Returns:
        south west corner of this rectangle.
      • getSE

        public Complex<C> getSE()
        Get south east corner.
        Returns:
        south east corner of this rectangle.
      • getNE

        public Complex<C> getNE()
        Get north east corner.
        Returns:
        north east corner of this rectangle.
      • exchangeNW

        public Rectangle<C> exchangeNW(Complex<C> c)
        Exchange NW corner.
        Parameters:
        c - new NW corner.
        Returns:
        rectangle with north west corner c of this rectangle.
      • exchangeSW

        public Rectangle<C> exchangeSW(Complex<C> c)
        Exchange SW corner.
        Parameters:
        c - new SW corner.
        Returns:
        rectangle with south west corner c of this rectangle.
      • exchangeSE

        public Rectangle<C> exchangeSE(Complex<C> c)
        Exchange SE corner.
        Parameters:
        c - new SE corner.
        Returns:
        rectangle with south east corner c of this rectangle.
      • exchangeNE

        public Rectangle<C> exchangeNE(Complex<C> c)
        Exchange NE corner.
        Parameters:
        c - new NE corner.
        Returns:
        rectangle with north east corner c of this rectangle.
      • contains

        public boolean contains(Complex<C> c)
        Contains a point.
        Parameters:
        c - point.
        Returns:
        true if c is contained in this rectangle, else false.
      • contains

        public boolean contains(Rectangle<C> r)
        Contains a rectangle.
        Parameters:
        r - rectangle.
        Returns:
        true if r is contained in this rectangle, else false.
      • randomPoint

        public Complex<C> randomPoint()
        Random point of recatangle.
        Returns:
        a random point contained in this rectangle.
      • copy

        public Rectangle<C> copy()
        Copy this.
        Returns:
        a copy of this.
      • getCenter

        public Complex<C> getCenter()
        Complex center.
        Returns:
        r + i m of the center.
      • getRationalCenter

        public Complex<BigRational> getRationalCenter()
        Complex of BigRational approximation of center.
        Returns:
        r + i m as rational approximation of the center.
      • getDecimalCenter

        public Complex<BigDecimal> getDecimalCenter()
        Complex of BigDecimal approximation of center.
        Returns:
        r + i m as decimal approximation of the center.
      • centerApprox

        public String centerApprox()
        Approximation of center.
        Returns:
        r + i m as string of decimal approximation of the center.
      • length

        public C length()
        Length.
        Returns:
        |ne-sw|**2;
      • rationalLength

        public BigRational rationalLength()
        Rational Length.
        Returns:
        rational(|ne-sw|**2);
      • lengthReal

        public C lengthReal()
        Length real side.
        Returns:
        |re(ne)-re(sw)|;
      • lengthImag

        public C lengthImag()
        Length imaginary side.
        Returns:
        |im(ne)-im(sw)|;

SCaVis 2.0 © jWork.ORG