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:
Serializable
Rectangle. For example isolating rectangle for complex roots.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionApproximation of center.boolean
Contains a point.boolean
Contains a rectangle.copy()
Copy this.boolean
Comparison with any other object.exchangeNE
(Complex<C> c) Exchange NE corner.exchangeNW
(Complex<C> c) Exchange NW corner.exchangeSE
(Complex<C> c) Exchange SE corner.exchangeSW
(Complex<C> c) Exchange SW corner.Complex center.Complex of BigDecimal approximation of center.getNE()
Get north east corner.getNW()
Get north west corner.Complex of BigRational approximation of center.getSE()
Get south east corner.getSW()
Get south west corner.int
hashCode()
Hash code for this Rectangle.length()
Length.Length imaginary side.Length real side.Random point of recatangle.Rational Length.toScript()
Get a scripting compatible string representation.toString()
String representation of Rectangle.
-
Field Details
-
corners
rectangle corners.
-
-
Constructor Details
-
Rectangle
Constructor.- Parameters:
c
- array of corners.
-
Rectangle
Constructor.- Parameters:
mid
- corner.
-
Rectangle
Constructor.- Parameters:
sw
- corner.ne
- corner.
-
Rectangle
Constructor.nw|0 ne|3 sw|1 se|2
- Parameters:
nw
- corner.sw
- corner.se
- corner.ne
- corner.
-
-
Method Details
-
toString
String representation of Rectangle. -
toScript
Get a scripting compatible string representation.- Returns:
- script compatible representation for this Rectangle.
-
getNW
Get north west corner.- Returns:
- north west corner of this rectangle.
-
getSW
Get south west corner.- Returns:
- south west corner of this rectangle.
-
getSE
Get south east corner.- Returns:
- south east corner of this rectangle.
-
getNE
Get north east corner.- Returns:
- north east corner of this rectangle.
-
exchangeNW
Exchange NW corner.- Parameters:
c
- new NW corner.- Returns:
- rectangle with north west corner c of this rectangle.
-
exchangeSW
Exchange SW corner.- Parameters:
c
- new SW corner.- Returns:
- rectangle with south west corner c of this rectangle.
-
exchangeSE
Exchange SE corner.- Parameters:
c
- new SE corner.- Returns:
- rectangle with south east corner c of this rectangle.
-
exchangeNE
Exchange NE corner.- Parameters:
c
- new NE corner.- Returns:
- rectangle with north east corner c of this rectangle.
-
contains
Contains a point.- Parameters:
c
- point.- Returns:
- true if c is contained in this rectangle, else false.
-
contains
Contains a rectangle.- Parameters:
r
- rectangle.- Returns:
- true if r is contained in this rectangle, else false.
-
randomPoint
Random point of recatangle.- Returns:
- a random point contained in this rectangle.
-
copy
Copy this.- Returns:
- a copy of this.
-
equals
Comparison with any other object. -
hashCode
public int hashCode()Hash code for this Rectangle. -
getCenter
Complex center.- Returns:
- r + i m of the center.
-
getRationalCenter
Complex of BigRational approximation of center.- Returns:
- r + i m as rational approximation of the center.
-
getDecimalCenter
Complex of BigDecimal approximation of center.- Returns:
- r + i m as decimal approximation of the center.
-
centerApprox
Approximation of center.- Returns:
- r + i m as string of decimal approximation of the center.
-
length
Length.- Returns:
- |ne-sw|**2;
-
rationalLength
Rational Length.- Returns:
- rational(|ne-sw|**2);
-
lengthReal
Length real side.- Returns:
- |re(ne)-re(sw)|;
-
lengthImag
Length imaginary side.- Returns:
- |im(ne)-im(sw)|;
-