|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object
|
+--java.util.AbstractCollection
|
+--java.util.AbstractList
|
+--java.util.Vector
|
+--jumbo.euclid.EuclidVector
|
+--jumbo.euclid.Real2Vector
Real2Vector - a (Java) Vector of Real2s. (Note that 'Vector' is used by Java to describe an array of objects - there is no relationship to geometrical vectors in this package.)
Support is also given for the two component arrays as RealArrays
Default is an empty (Java) Vector;
| Fields inherited from class java.util.Vector |
capacityIncrement,
elementCount,
elementData |
| Fields inherited from class java.util.AbstractList |
modCount |
| Constructor Summary | |
Real2Vector()
|
|
Real2Vector(double[] flarray)
Formed by feeding in an existing array to a 2xn matrix. |
|
Real2Vector(int size)
create a Vector with given number of points |
|
Real2Vector(int n,
double[] x,
double[] y)
from two parallel arrays of x, y - by REFERENCE |
|
Real2Vector(Real2Vector pv)
copy constructor from Real2Vector COPIES pv |
|
Real2Vector(RealArray m)
constructor from RealArray - by REFERENCE |
|
| Method Summary | |
void |
addElement(Real2 p)
|
Angle |
angle(int i1,
int i2,
int i3)
get angle between 3 points |
Angle |
angle(IntSet is)
get angle between 3 points |
double |
distance(int i1,
int i2)
get distance between 2 points |
double |
distance(IntSet is)
get distance between 2 points |
Real2 |
getCentroid()
get centroid of all points |
int |
getClosestPoint(Real2 p)
get the closest point (both ranges are assumed to have the same scales |
double |
getCoordinate(int i,
Choice2 j)
get a single coordinate value |
int |
getPoint(Real2 p,
double width,
double height)
get the index of the first point within a box centered on p (i.e. |
RealRange |
getRange(Choice2 ax)
get range of one coordinate |
Real2Range |
getRange2()
get range of both coordinates |
Real2 |
getReal2(int i)
get the i'th Real2 |
RealArray |
getXorY(Choice2 axis)
get a single coordinate array - e.g. |
RealArray |
getXY()
get the coordinate coordinate array as doubles x,y,x,y, ... |
java.lang.String |
makeString()
we are not allowed a toString() here, as Vector is a final class |
void |
multiplyBy(double f)
multiply all coordinates be a given scalar (i.e. |
void |
plus(Real2 p)
add a Real2 to all elements of 'this'; MODIFIES 'this' |
static Real2Vector |
regularPolygon(int nsides,
double rad)
make a regular polygon, zero point at (0, rad); points go clockwise |
void |
rotateAboutCentroid(Angle a)
rotate about centroid by given angle; MODIFIES 'this' |
void |
setElementAt(Real2 v,
int i)
|
Real2Vector |
sortAscending(Choice2 ax)
sort ARRAY on X or Y coordinate; returns new array |
Real2Vector |
sortDescending(Choice2 ax)
sort ARRAY on X or Y coordinate; returns new array |
void |
sortXYAscending()
sort X and Y within each point; MODIFIES array |
void |
sortXYDescending()
sort X and Y within each point; MODIFIES array |
Real2Vector |
subArray(IntSet is)
create a NEW subset of the points; points are COPIED |
IntSet |
subSet(Real2Range r)
create a subset of the points within a box |
void |
subtract(Real2 v)
translate negatively; MODIFIES 'this' |
void |
swapXY()
swap all X and Y coordinates; MODIFIES array |
void |
transformBy(Transform2 t)
transforms 'this' by rotation-translation matrix; MODIFIES 'this' |
void |
translateBy(Real2 v)
translate by a vector, synonym for 'plus'; MODIFIES 'this' |
| Methods inherited from class jumbo.euclid.EuclidVector |
concatenate |
| Methods inherited from class java.util.Vector |
add,
add,
addAll,
addAll,
addElement,
capacity,
clear,
clone,
contains,
containsAll,
copyInto,
elementAt,
elements,
ensureCapacity,
equals,
firstElement,
get,
hashCode,
indexOf,
indexOf,
insertElementAt,
isEmpty,
lastElement,
lastIndexOf,
lastIndexOf,
remove,
remove,
removeAll,
removeAllElements,
removeElement,
removeElementAt,
removeRange,
retainAll,
set,
setElementAt,
setSize,
size,
subList,
toArray,
toArray,
toString,
trimToSize |
| Methods inherited from class java.util.AbstractList |
iterator,
listIterator,
listIterator |
| Methods inherited from class java.lang.Object |
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
| Constructor Detail |
public Real2Vector()
public Real2Vector(int size)
public Real2Vector(double[] flarray)
throws BadArgumentException
public Real2Vector(int n,
double[] x,
double[] y)
public Real2Vector(RealArray m)
throws BadArgumentException
public Real2Vector(Real2Vector pv)
| Method Detail |
public void addElement(Real2 p)
public void setElementAt(Real2 v,
int i)
throws java.lang.ArrayIndexOutOfBoundsException
public RealRange getRange(Choice2 ax)
public Real2Range getRange2()
public Real2Vector subArray(IntSet is)
throws BadSubscriptException
public IntSet subSet(Real2Range r)
public int getClosestPoint(Real2 p)
public int getPoint(Real2 p,
double width,
double height)
public Real2 getCentroid()
public void translateBy(Real2 v)
public void plus(Real2 p)
public void subtract(Real2 v)
public void multiplyBy(double f)
public double distance(int i1,
int i2)
public double distance(IntSet is)
throws BadArgumentException
public Angle angle(int i1,
int i2,
int i3)
throws ZeroVectorException
public Angle angle(IntSet is)
throws BadArgumentException,
ZeroVectorException
public Real2 getReal2(int i)
public RealArray getXY()
public double getCoordinate(int i,
Choice2 j)
public RealArray getXorY(Choice2 axis)
public void swapXY()
public void sortXYAscending()
public void sortXYDescending()
public Real2Vector sortAscending(Choice2 ax)
public Real2Vector sortDescending(Choice2 ax)
public void transformBy(Transform2 t)
public void rotateAboutCentroid(Angle a)
public static Real2Vector regularPolygon(int nsides,
double rad)
public java.lang.String makeString()
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||