|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.geom.Point2D java.awt.geom.Point2D.Double jpicedt.graphic.PicPoint
public class PicPoint
Enhancement of Point2D.Double with convenient formatting methods and constructors.
Nested Class Summary | |
---|---|
static class |
PicPoint.XComparator
a comparator b/w PicPoint for X-axis ordering |
static class |
PicPoint.YComparator
a comparator b/w PicPoint for Y-axis ordering |
Nested classes/interfaces inherited from class java.awt.geom.Point2D |
---|
Point2D.Double, Point2D.Float |
Field Summary | |
---|---|
static PicPoint.XComparator |
X_COMPARATOR
|
static PicPoint.YComparator |
Y_COMPARATOR
|
Fields inherited from class java.awt.geom.Point2D.Double |
---|
x, y |
Constructor Summary | |
---|---|
PicPoint()
Construct a (0,0) point. |
|
PicPoint(double[] f)
Construct a point from the first two elements of the given array. |
|
PicPoint(double x,
double y)
Construct (x,y) |
|
PicPoint(float[] f)
Construct a point from the first two elements of the given array. |
|
PicPoint(Number x,
Number y)
Construct a point from the given pair of Number (using their double value). |
|
PicPoint(Point2D p)
Clone the given point. |
|
PicPoint(Point2D p1,
Point2D p2,
double ratio)
Construct a new PicPoint "p" located on the line joining p1 with p2, so that (p1,p) = ratio * (p1,p2) |
|
PicPoint(String str)
Construct a point by parsing a String similar to that given by the toString() method, ie (x,y) . |
Method Summary | |
---|---|
PicPoint |
apply(AffineTransform at)
Apply the given AffineTransform to the coordinates of this point |
PicPoint |
clone()
Creates and returns a deep copy of this PicPoint. |
static void |
main(String[] args)
validation tests |
PicPoint |
middle(PicPoint other)
Translate this point to the middle of the segment made of [this,other]. |
PicPoint |
mirror(PicPoint ptOrg,
PicVector normalVector)
A le même effet que l'appel à mirror(ptOrg,normalVector,this) , c'est à dire que la
valeur de this est changée par reflexion relativement à
l'axe passant par ptOrg et normal à
normalVector . |
PicPoint |
mirror(PicPoint ptOrg,
PicVector normalVector,
PicPoint ret)
Renvoie l'image par réflection du PicPoint
this relativement à l'axe passant par le point
ptOrg et normal au vecteur normalVector . |
double |
norm1Distance(Point2D other)
Compute the distance with regards to norm norm1. |
double |
normInfDistance(Point2D other)
Compute the distance with regards to norm normInf. |
PicPoint |
project(PicPoint p1,
PicPoint p2)
Project this point onto the line joining p1 and p2. |
PicPoint |
project(PicPoint p1,
PicPoint p2,
PicPoint dir)
Project this point onto the line joining p1 and p2. |
PicPoint |
rotate(PicPoint ptOrg,
double angle)
Apply a rotation of center ptOrg and the given angle in radians to this PicPoint Current implementation arranges for a very fast code if angle is PI, PI/2 or -PI/2. |
PicPoint |
scale(double ptOrgX,
double ptOrgY,
double s)
Apply a scaling transform to this point. |
PicPoint |
scale(double ptOrgX,
double ptOrgY,
double sx,
double sy)
Apply a scaling transform to this point. |
PicPoint |
scale(PicPoint ptOrg,
double s)
Apply a scaling transform to this point. |
PicPoint |
scale(PicPoint ptOrg,
double sx,
double sy)
Apply a scaling transform to this point. |
PicPoint |
setCoordinates(double x,
double y)
Set the coordinates of this point from the given pair |
PicPoint |
setCoordinates(PicPoint pt)
Set the coordinates of this point from the given point. |
PicPoint |
shear(PicPoint ptOrg,
double shx,
double shy)
Apply a shearing transform of given parameters wrt to the given origin, to this PicPoint |
PicPoint |
symmetry(PicPoint center)
Apply a central-symmetry wrt the given point |
static PicPoint |
symmetry(PicPoint center,
PicPoint src)
Return a new PicPoint obtained by applying a central-symmetry with the given center to the given src point. |
Complex |
toComplex()
Return the equivalent complex number of this , that is to say complex number with real part
equal to this.getX() , and imaginary part equal to this.getY() ; |
double[] |
toDoubleArray(double[] f)
|
float[] |
toFloatArray(float[] f)
|
PicPoint |
toMm(double unitLength)
Convert a PicPoint with coordinates expressed in the given unitlenth (expressed in mm), to a new PicPoint in mm coordinates. |
PicPoint |
toMm(double xUnit,
double yUnit)
Convert a PicPoint with coordinate expressed in the given unitlenths along X- and Y-axis (the latter being expressed in mm) to a new PicPoint in mm coordinate. |
String |
toString()
Return a "(x,y)" string representing this point. |
PicPoint |
translate(double dx,
double dy)
translates this point by (dx,dy) |
PicPoint |
translate(PicPoint p)
translates this point by (p.x, p.y), ie the given point is considered as a translation vector. |
PicPoint |
translate(PicPoint p,
double a)
translates this point by a*(p.x, p.y), ie the given point is considered as a translation vector scaled by the given double. |
PicPoint |
translate(PicPoint p1,
PicPoint p2)
translates this point by (p2.x-p1.x, p2.y-p2.y), ie the given point is considered as a translation vector build from the two given points. |
PicPoint |
translate(PicPoint p1,
PicPoint p2,
double a)
translates this point by a*(p2.x-p1.x, p2.y-p2.y), ie the given point is considered as a translation vector build from the two given points, then scaled by the given double. |
Methods inherited from class java.awt.geom.Point2D.Double |
---|
getX, getY, setLocation |
Methods inherited from class java.awt.geom.Point2D |
---|
distance, distance, distance, distanceSq, distanceSq, distanceSq, equals, hashCode, setLocation |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final PicPoint.XComparator X_COMPARATOR
public static final PicPoint.YComparator Y_COMPARATOR
Constructor Detail |
---|
public PicPoint()
public PicPoint(Point2D p)
public PicPoint(Point2D p1, Point2D p2, double ratio)
ratio
- any double, positive or not.public PicPoint(double x, double y)
public PicPoint(Number x, Number y)
public PicPoint(float[] f)
public PicPoint(double[] f)
public PicPoint(String str) throws NumberFormatException
toString()
method, ie (x,y)
.
NumberFormatException
Method Detail |
---|
public PicPoint clone()
clone
in class Point2D
public PicPoint setCoordinates(PicPoint pt)
public PicPoint setCoordinates(double x, double y)
public PicPoint mirror(PicPoint ptOrg, PicVector normalVector, PicPoint ret)
PicPoint
this
relativement à l'axe passant par le point
ptOrg
et normal au vecteur normalVector
.
si un PicPoint
ret
est passé en argument, il
est utilisé pour le résultat. Si ret
est égal à
this
, alors, la réflection est effectuée sur
this
.
ptOrg
- le PicPoint
par lequel passe l'axe de réflection.normalVector
- le PicVector
normal à l'axe de réflectionret
- un PicPoint
permettant d'allouer l'image à
l'extérieur de la méthode. Omettre ret
pour que
mirror
se charge de l'allocation.
this
.public PicPoint mirror(PicPoint ptOrg, PicVector normalVector)
mirror(ptOrg,normalVector,this)
, c'est à dire que la
valeur de this
est changée par reflexion relativement à
l'axe passant par ptOrg
et normal à
normalVector
.
normalVector
- le PicVector
normal à l'axe de réflexionptOrg
- un PicPoint
par lequel passe l'axe de réflexion
this
.public double norm1Distance(Point2D other)
public double normInfDistance(Point2D other)
public Complex toComplex()
this
, that is to say complex number with real part
equal to this.getX()
, and imaginary part equal to this.getY()
;
public float[] toFloatArray(float[] f)
f
is null, a new array is allocated ;
otherwise, the given array is directly modified and returned for convenience.public double[] toDoubleArray(double[] f)
f
is null, a new array is allocated ;
otherwise, the given array is directly modified and returned for convenience.public String toString()
toString
in class Point2D.Double
public PicPoint toMm(double unitLength)
unitLength
- In mmpublic PicPoint toMm(double xUnit, double yUnit)
xUnit
- unilength along the X-axis expressed in mmyUnit
- unilength along the Y-axis expressed in mmpublic PicPoint translate(double dx, double dy)
public PicPoint translate(PicPoint p)
public PicPoint translate(PicPoint p1, PicPoint p2)
public PicPoint translate(PicPoint p, double a)
public PicPoint translate(PicPoint p1, PicPoint p2, double a)
public PicPoint symmetry(PicPoint center)
public static PicPoint symmetry(PicPoint center, PicPoint src)
public PicPoint scale(PicPoint ptOrg, double sx, double sy)
sx
- Scaling factors along the X-axissy
- Scaling factors along the Y-axisptOrg
- transformation centre
public PicPoint scale(PicPoint ptOrg, double s)
s
- Scaling factors along the X- and Y- axisptOrg
- transformation centre
public PicPoint scale(double ptOrgX, double ptOrgY, double s)
s
- Scaling factors along the X- and Y- axisptOrgX
- X-coord of transformation centreptOrgY
- Y-coord of transformation centre
public PicPoint scale(double ptOrgX, double ptOrgY, double sx, double sy)
sx
- Scaling factors along the X-axissy
- Scaling factors along the Y-axisptOrgX
- X-coord of transformation centreptOrgY
- Y-coord of transformation centre
public PicPoint rotate(PicPoint ptOrg, double angle)
public PicPoint shear(PicPoint ptOrg, double shx, double shy)
public PicPoint middle(PicPoint other)
public PicPoint project(PicPoint p1, PicPoint p2)
public PicPoint project(PicPoint p1, PicPoint p2, PicPoint dir)
dir
- a vector indicating the projection axis
public static void main(String[] args)
public PicPoint apply(AffineTransform at)
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |