| Package | Description |
|---|---|
| org.xmlcml.euclid |
| Modifier and Type | Class and Description |
|---|---|
class |
Complex
A complex number derived from Real2
Complex represents a complex number A reasonable number of arithmetic
operations are included DeMoivre's theorem is used for some of them so there
may be quicker implementations elsewhere.
|
class |
Point2
2-dimensional point class
PROBABLY OBSOLETE - WE USE Real2 instead
Point2 represents a 2-dimensional point.
|
class |
Vector2
a 2-D vector relationship with Complex and Polar not fully worked out.
|
| Modifier and Type | Method and Description |
|---|---|
static Real2[] |
Real2.addPolygonOnLine(Real2 point1,
Real2 point2,
int nPoints,
int end,
Real2 repelPoint)
creates a polygon
returns a point array from two points Serial numbers of points are 0 and
end that is point1 is points[0] and point2 is points[end] if end == 0,
end =>1
|
static Real2 |
Real2.createFromString(String s)
reads output format from toString()
"(x,y)"
|
Real2 |
Line2.createPointOnLine(Double dist)
creates point at (signed) distance dist from "from" point
newPoint = from + (dist / line.length) * vector
|
Real2 |
Line2.createPointOnLine(Double dist,
int index)
creates point at (signed) distance dist from index point
vector = xy(1-index) <- xy(index)
newPoint = xy(index) + (dist / line.length) * vector
|
Real2 |
Real2Range.distanceOutside(Real2 p)
gets minimum X and Y translations required to move point into range
uses RealRange.distanceOutside() - see this
|
Real2 |
Real2Array.elementAt(int elem)
get element.
|
Real2 |
Real2.format(int places)
round to decimal places.
|
Real2 |
Real2Array.get(int elem)
get element.
|
Real2 |
Real2Vector.get(int i)
gets Real2 element.
|
Real2 |
Real2Vector.getCentroid()
get centroid of all points.
|
Real2 |
Real2Range.getCentroid()
get yrange
|
static Real2 |
Real2.getCentroid(List<Real2> p2Vector)
get centroid of all points.
|
Real2[] |
Real2Range.getCorners()
gets lower left and upper right.
|
Real2 |
Window2.getDim() |
Real2 |
Window2.getExtent(int axis)
get extent of a given axis (X or Y);
|
Real2 |
Window2.getFarPoint() |
Real2 |
Line2.getFrom() |
Real2 |
Line2.getIntersection(Line2 line1)
get intersection of two lines
see softSurfer algorithm
|
Real2 |
Real2Array.getLastElement() |
Real2 |
Real2Array.getLastPoint() |
Real2 |
Real2Array.getMean()
gets unweighted mean of points.
|
Real2 |
Line2.getMidPoint()
get mid point
|
Real2 |
Real2.getMidPoint(Real2 p)
point midway between 'this' and 'p'
|
Real2 |
Real2Range.getMidPoint(Real2Range.BoxDirection direction)
returns midPoint of box edge.
|
Real2 |
Line2.getNearestPointNew(Real2 point)
may be redundant...
|
Real2 |
Line2.getNearestPointOnLine(Real2 point)
get nearest point on infinite line.
|
Real2 |
Window2.getOrigin() |
Real2 |
Real2Array.getPointWithMaximumX() |
Real2 |
Real2Array.getPointWithMaximumY() |
Real2 |
Real2Array.getPointWithMinimumX() |
Real2 |
Real2Array.getPointWithMinimumY() |
Real2 |
Real2Vector.getReal2(int i)
get the i'th Real2
|
Real2 |
Line2.getTo() |
Real2 |
Real2.getTransformed(Transform2 t)
gets a point transformed by a rot-trans matrix does NOT MODIFY 'this'
|
Real2 |
Transform2.getTranslation()
get translation component only
|
Real2 |
Real2.getUnitVector()
get unit vector
|
Real2 |
Polar.getXY()
get coordinates.
|
Real2 |
Line2.getXY(int i)
get point at either end.
|
Real2 |
Real2.makePoint(double rad,
double theta)
make a new point at (dist, theta) from this
|
Real2 |
Real2Interval.midPoint()
gets midpoint.
|
Real2 |
Real2.multiplyBy(double f)
retuen multiplication of a point by a scalar
does not alter this
|
Real2 |
Real2.plus(Real2 r2)
add two points to give vector sum
|
Real2 |
Real2.subtract(Real2 r2)
subtract two points to give vector difference
|
| Modifier and Type | Method and Description |
|---|---|
List<Real2> |
Univariate.getBinsSortedByFrequency()
gets bin values and frequencies sorted by frequency
each Real2 is x-value, frequency
zero counts are not reported
|
List<Real2> |
Real2Array.getList() |
List<Real2> |
Real2Vector.getReal2List()
get List of Real2s.
|
List<Real2> |
Real2Vector.getVector()
access the vector.
|
Iterator<Real2> |
Real2Array.iterator() |
| Modifier and Type | Method and Description |
|---|---|
void |
Real2Array.add(Real2 r2) |
void |
Real2Vector.add(Real2 p)
appens a Real2.
|
void |
Real2Range.add(Real2 p)
add a Real2 to a range
|
static Real2[] |
Real2.addPolygonOnLine(Real2 point1,
Real2 point2,
int nPoints,
int end,
Real2 repelPoint)
creates a polygon
returns a point array from two points Serial numbers of points are 0 and
end that is point1 is points[0] and point2 is points[end] if end == 0,
end =>1
|
boolean |
Line2.contains(Real2 point,
double eps,
boolean allowExtension)
does a line contain a point.
|
Real2 |
Real2Range.distanceOutside(Real2 p)
gets minimum X and Y translations required to move point into range
uses RealRange.distanceOutside() - see this
|
double |
Real2.dotProduct(Real2 r)
get dot product
|
boolean |
Real2Vector.encloses(Real2 point)
if real2Vector is treated as a polygon, determines whether point
is inside it
// The function will return true if the point x,y is inside the polygon, or
// false if it is not.
|
static Transform2 |
Transform2.flipAboutVector(Real2 r)
get Transformation to mirror ('flip') across an axis NOT YET CHECKED
|
static Angle |
Real2.getAngle(Real2 p1,
Real2 p2,
Real2 p3)
get angle between 3 Real2s (the second is in the centre)
|
int |
Real2Vector.getClosestPoint(Real2 p)
get the closest point (both ranges are assumed to have the same scales
|
double |
Real2.getDistance(Real2 r)
get distance to another Real2
|
double |
Line2.getDistanceFromPoint(Real2 point)
Deprecated.
use new name (unsignedDistanceFromPoint)
|
static Int2 |
Int2.getInt2(Real2 xy2)
cast a Real2 into an Int2.
|
double |
Line2.getLambda(Real2 p)
gets multiplier of point from "from"
finds nearest point (pp) on line (so avoids rounding errors)
then finds pp = from + vector * lambda
if pp is within segment , lambda is 0, 1
|
Real2 |
Real2.getMidPoint(Real2 p)
point midway between 'this' and 'p'
|
Real2 |
Line2.getNearestPointNew(Real2 point)
may be redundant...
|
Real2 |
Line2.getNearestPointOnLine(Real2 point)
get nearest point on infinite line.
|
int |
Real2Vector.getPoint(Real2 p,
double width,
double height)
get the index of the first point within a box centered on p (that is p+-
width/2, height/2) or -1 if none
|
static Transform2 |
Transform2.getRotationAboutPoint(Angle angle,
Real2 point)
rotate about a point.
|
int |
Line2.getSerial(Real2 point,
double eps)
gets serial number of point in line specification
if point is within EPS of "from" returns 0
if point is within EPS of "to" returns 1
else returns -1
|
static int |
Real2.getSerialOfNearestPoint(List<Real2> p2v,
Real2 point)
get serialNumber of nearest point
|
int |
Real2Vector.getSerialOfNearestPoint(Real2 point)
get serialNumber of nearest point.
|
double |
Line2.getSignedDistanceFromPoint(Real2 point)
signed perpendicular distance from point to infinite line.
|
double |
Real2.getSquaredDistance(Real2 r)
get squared distance to another Real2
|
static Transform2 |
Transform2.getTransformToRotateAndStretchLine(Real2 pivotPoint,
Real2 movingPoint,
Real2 targetPoint)
transform describing the rotation and stretching of a line.
|
static Transform2 |
Transform2.getTranslationTransform(Real2 translation) |
double |
Line2.getUnsignedDistanceFromPoint(Real2 point)
perpendicular distance from point to infinite line.
|
boolean |
Real2Range.includes(Real2 p)
is an Real2 within a Real2Range
|
boolean |
Real2.isEqualTo(Real2 r)
Deprecated.
|
boolean |
Real2.isEqualTo(Real2 r,
double eps)
equality.
|
Real2 |
Real2.plus(Real2 r2)
add two points to give vector sum
|
void |
Real2Vector.plus(Real2 p)
add a Real2 to all elements of this.
|
void |
Real2.plusEquals(Real2 r2)
add two points to give vector sum
|
static Real2Vector |
Real2Vector.regularPolygon(int nsides,
Real2 p1,
Real2 p2,
boolean flip)
create regular polygon.
|
void |
Real2Vector.set(int i,
Real2 v) |
void |
Real2Array.setElement(int elem,
Real2 r2)
get element.
|
void |
Transform2.setTranslation(Real2 xy)
get translation component only
|
void |
Line2.setXY(Real2 xy,
int i)
set point at either end.
|
Real2 |
Real2.subtract(Real2 r2)
subtract two points to give vector difference
|
void |
Real2Vector.subtract(Real2 v)
translate negatively; MODIFIES 'this'
|
static String |
EuclidTestUtils.testEquals(Real2 a,
Real2 b,
double eps)
returns a message if arrays differ.
|
void |
Real2Vector.translateBy(Real2 v)
translate by a vector, synonym for plus.
|
| Modifier and Type | Method and Description |
|---|---|
static Real2 |
Real2.getCentroid(List<Real2> p2Vector)
get centroid of all points.
|
RealMatrix |
Real2Vector.getDistanceMatrix(List<Real2> coords2)
get rectangular distance matrix.
|
static RealMatrix |
Real2.getDistanceMatrix(List<Real2> coords1,
List<Real2> coords2)
get rectangular distance matrix.
|
static RealMatrix |
Real2.getDistanceMatrix(List<Real2> coords1,
List<Real2> coords2)
get rectangular distance matrix.
|
static int |
Real2.getSerialOfNearestPoint(List<Real2> p2v,
Real2 point)
get serialNumber of nearest point
|
| Constructor and Description |
|---|
Complex(Real2 a)
from base class
|
Line2(Real2 from,
Real2 to)
generates vector
|
Line2(Real2 from,
Vector2 v)
generates to
|
Line2AndReal2Calculator(Line2 line,
Real2 point) |
Real2(Real2 r)
copy constructor
|
Real2Range(Real2 r2a,
Real2 r2b)
create from min corner of box and max corner
|
Transform2(Real2 v1,
Real2 v2)
from 2 vector components - NOT checked for validity
|
Transform2(Real2 originIn,
Real2 dimensionIn,
Real2 originOut,
Real2 dimensionOut,
boolean keepAspectRatio)
graphics transform (transforms between rectangular coordinates
("windows") originIn maps onto originOut and dimensionIn (width, height)
onto dimensionOut.
|
Transform2(Transform2 t,
Real2 p)
from rotation about a point, given a matrix NOT CHECKED
|
Vector2(Real2 r)
constructor.
|
Window2(Real2 origin,
Real2 farPoint) |
| Constructor and Description |
|---|
Real2Array(List<Real2> points)
create from list of points.
|
Real2Vector(List<Real2> rList)
construct from list of Real2.
|
Copyright © 1994–2024 Peter Murray-Rust. All rights reserved.