public class Real2Array extends Object implements EuclidConstants, Iterable<Real2>
C_AMP, C_APOS, C_ATSIGN, C_BACKSLASH, C_BACKSPACE, C_CARET, C_COLON, C_COMMA, C_DEL, C_DOLLAR, C_EQUALS, C_FORMFEED, C_HASH, C_LANGLE, C_LBRAK, C_LCURLY, C_LSQUARE, C_MINUS, C_NBSP, C_NEWLINE, C_NL, C_PERCENT, C_PERIOD, C_PIPE, C_PLUS, C_POUND, C_QUERY, C_QUOT, C_RANGLE, C_RBRAK, C_RCURLY, C_RETURN, C_RSQUARE, C_SEMICOLON, C_SHRIEK, C_SLASH, C_SPACE, C_STAR, C_TAB, C_TILDE, C_UNDER, EPS, F_S, NONWHITEPUNC, NONWHITEPUNC0, NONWHITEPUNC0REGEX, ONE_THIRD, PUNC, S_AMP, S_APOS, S_ATSIGN, S_BACKSLASH, S_CARET, S_COLON, S_COMMA, S_DOLLAR, S_EMPTY, S_EQUALS, S_FORMFEED, S_HASH, S_LANGLE, S_LBRAK, S_LCURLY, S_LSQUARE, S_MINUS, S_NEWLINE, S_NL, S_PERCENT, S_PERIOD, S_PIPE, S_PLUS, S_POUND, S_QUERY, S_QUOT, S_RANGLE, S_RBRAK, S_RCURLY, S_RETURN, S_RSQUARE, S_SEMICOLON, S_SHRIEK, S_SLASH, S_SPACE, S_STAR, S_TAB, S_TILDE, S_UNDER, S_WHITEREGEX, TWO_THIRDS, U_S, WHITESPACE| Constructor and Description |
|---|
Real2Array()
default constructor gives an array of 0 points
|
Real2Array(int size)
create with RealArrays of pre-allocated size.
|
Real2Array(List<Real2> points)
create from list of points.
|
Real2Array(Real2Array r2a)
copy
|
Real2Array(RealArray x,
RealArray y)
make an Real2_Array from 2 RealVec's; takes a copy
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(Real2 r2) |
void |
add(Real2Array real2Array) |
static Real2Array |
createFromCoords(String coords) |
static Real2Array |
createFromPairs(RealArray ra)
make an Real2_Array from pairs of numbers x1,y1 ..
|
static Real2Array |
createFromPairs(String sss,
String delimiter)
make an Real2_Array from pairs of numbers separated by delimiter
|
Real2Array |
createSubArray(int start)
create subArray starting at start inclusive
|
Real2Array |
createSubArray(int start,
int end)
create subArray
|
void |
deleteElement(int i)
delete element.
|
Real2 |
elementAt(int elem)
get element.
|
Real2Array |
format(int places)
round to decimal places.
|
Real2 |
get(int elem)
get element.
|
Real2 |
getLastElement() |
Real2 |
getLastPoint() |
List<Real2> |
getList() |
Real2 |
getMean()
gets unweighted mean of points.
|
Real2Array |
getMidPointArray(Real2Array real2Array)
gets average of two Real2Arrays.
|
Real2 |
getPointWithMaximumX() |
Real2 |
getPointWithMaximumY() |
Real2 |
getPointWithMinimumX() |
Real2 |
getPointWithMinimumY() |
Real2Range |
getRange2()
get max and min value of Real2_Array
|
String |
getStringArray()
to space-separated string.
|
RealArray |
getXArray()
extract X array.
|
RealArray |
getYArray()
extract Y array.
|
boolean |
isEqualTo(Real2Array r2b,
double epsilon)
compares the arrays
|
Iterator<Real2> |
iterator() |
void |
reverse()
reverse direction of array MODIFIES THIS
|
void |
setElement(int elem,
Real2 r2)
get element.
|
int |
size()
size of array.
|
void |
sortAscending(int xy)
sorts so that x0y0 has lowest x (0) or y (1)
|
void |
sortDescending(int xy)
sorts so that x0y0 has highest x (0) or y (1)
|
Double |
sumProductOfAllElements() |
String |
toString()
to string.
|
void |
transformBy(Transform2 t2) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic Real2Array()
public Real2Array(Real2Array r2a)
r2a - public Real2Array(RealArray x, RealArray y) throws EuclidRuntimeException
x - y - EuclidRuntimeException - x and x must have number of elementspublic Real2Array(int size)
size - public Real2Range getRange2()
public boolean isEqualTo(Real2Array r2b, double epsilon)
r2b - array to compare toepsilon - tolerance in coordinatespublic void add(Real2 r2)
r2 - public void add(Real2Array real2Array)
real2Array - public static Real2Array createFromPairs(String sss, String delimiter)
sss - delimiter - (might be a regex e.g. ",| " (comma or space))EuclidRuntimeException - x and x must have number of elementspublic static Real2Array createFromPairs(RealArray ra)
ra - EuclidRuntimeException - x and x must have number of elementspublic RealArray getXArray()
public RealArray getYArray()
public int size()
public Real2 elementAt(int elem)
elem - public Real2 get(int elem)
elem - public void setElement(int elem,
Real2 r2)
elem - r2 - public void deleteElement(int i)
i - public void transformBy(Transform2 t2)
public Real2Array format(int places)
places - public String getStringArray()
public Real2 getLastElement()
public void reverse()
public void sortAscending(int xy)
xy - = 0 sort on x; xy = 1 sort on ypublic void sortDescending(int xy)
xy - = 0 sort on x; xy = 1 sort on ypublic Real2Array createSubArray(int start)
start - public Real2Array createSubArray(int start, int end)
start - inclusiveend - inclusivepublic static Real2Array createFromCoords(String coords)
public Real2 getPointWithMinimumX()
public Real2 getPointWithMaximumX()
public Real2 getPointWithMinimumY()
public Real2 getPointWithMaximumY()
public Real2Array getMidPointArray(Real2Array real2Array)
real2Array - public Real2 getMean()
public Double sumProductOfAllElements()
public Real2 getLastPoint()
Copyright © 1994–2024 Peter Murray-Rust. All rights reserved.