Package edu.jas.root
Class Rectangle<C extends RingElem<C> & Rational>
- java.lang.Object
-
- edu.jas.root.Rectangle<C>
-
- Type Parameters:
C
- coefficient type.
- All Implemented Interfaces:
java.io.Serializable
public class Rectangle<C extends RingElem<C> & Rational> extends java.lang.Object implements java.io.Serializable
Rectangle. For example isolating rectangle for complex roots.- Author:
- Heinz Kredel
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
centerApprox()
Approximation of center.boolean
contains(Complex<C> c)
Contains a point.boolean
contains(Rectangle<C> r)
Contains a rectangle.Rectangle<C>
copy()
Copy this.boolean
equals(java.lang.Object b)
Comparison with any other object.Rectangle<C>
exchangeNE(Complex<C> c)
Exchange NE corner.Rectangle<C>
exchangeNW(Complex<C> c)
Exchange NW corner.Rectangle<C>
exchangeSE(Complex<C> c)
Exchange SE corner.Rectangle<C>
exchangeSW(Complex<C> c)
Exchange SW corner.Complex<C>
getCenter()
Complex center.Complex<BigDecimal>
getDecimalCenter()
Complex of BigDecimal approximation of center.Complex<C>
getNE()
Get north east corner.Complex<C>
getNW()
Get north west corner.Complex<BigRational>
getRationalCenter()
Complex of BigRational approximation of center.Complex<C>
getSE()
Get south east corner.Complex<C>
getSW()
Get south west corner.int
hashCode()
Hash code for this Rectangle.C
length()
Length.C
lengthImag()
Length imaginary side.C
lengthReal()
Length real side.Complex<C>
randomPoint()
Random point of recatangle.BigRational
rationalLength()
Rational Length.java.lang.String
toScript()
Get a scripting compatible string representation.java.lang.String
toString()
String representation of Rectangle.
-
-
-
Method Detail
-
toString
public java.lang.String toString()
String representation of Rectangle.- Overrides:
toString
in classjava.lang.Object
- See Also:
Object.toString()
-
toScript
public java.lang.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.
-
equals
public boolean equals(java.lang.Object b)
Comparison with any other object.- Overrides:
equals
in classjava.lang.Object
- See Also:
Object.equals(java.lang.Object)
-
hashCode
public int hashCode()
Hash code for this Rectangle.- Overrides:
hashCode
in classjava.lang.Object
- See Also:
Object.hashCode()
-
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 java.lang.String centerApprox()
Approximation of center.- Returns:
- r + i m as string of decimal approximation of the center.
-
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)|;
-
-