|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--opale.m2d.ker.Object2D
|
+--opale.m2d.ker.Vector2D
This class represents a vector in R².
| Field Summary | |
double |
x
public members. |
double |
y
public members. |
| Constructor Summary | |
Vector2D()
Constructor by default. |
|
Vector2D(OIJ rep)
Constucts and intializes the vector at (0; 0) with a OIJ specified. |
|
Vector2D(OIJ rep,
double x,
double y)
Constucts and intializes the vector at (x; y) with a OIJ specified. |
|
Vector2D(Point2D p,
Point2D q)
Constructs a vector from two objects Point2D. |
|
Vector2D(Vector2D v)
Constructs and initializes a vector with the same location as the specified Vector2D object. |
|
| Method Summary | |
void |
changeOIJ(OIJ rep)
Effectue un changement de repere du vecteur. |
java.lang.Object |
clone()
Creates a new object of the same class and with the same contents as this vector. |
boolean |
equals(java.lang.Object obj)
Determines whether two .vectors are equal. |
double |
getX()
Returns the X coordinate of the vector. |
double |
getY()
Returns the Y coordinate of the vector. |
double |
norm()
Computes the norm of this vector. |
static double |
norm(double x,
double y)
Computes the norm of a vector (x ; y). |
static double |
norm(Vector2D v)
Computes the norm of a vector v. |
double |
normSq()
Computes the square of the norm of this vector. |
static double |
normSq(double x,
double y)
Computes the square of the norm of a vector (x ; y). |
static double |
normSq(Vector2D v)
Computes the square of the norm of a vector v. |
int |
readKeyWord(java.lang.String word,
RFile f,
Pack2D p)
Interpret a keyword read in a file. |
void |
rotate(double theta)
Rotate l'objet graphique de l'angle theta autour de l'origine |
void |
rotate(double x,
double y,
double theta)
Rotate l'objet graphique de l'angle theta autour d'un point |
void |
set(double x,
double y)
Sets the coordinates of this vector. |
void |
set(Vector2D v)
Sets the coordinates of the vector to the specified vector. |
void |
setX(double x)
Sets the X coordinate of this vector to the specified double coordinate. |
void |
setY(double y)
Sets the Y coordinate of this vector to the specified double coordinate. |
java.lang.String |
toString()
Returns a string representation of this object. |
void |
transform(AffineTransform2D t)
Transforms the object by a general transform AffineTransform. |
void |
translate(double dx,
double dy)
Translate l'objet graphique du vecteur(dx, dy). |
void |
writeFileMore(WFile f,
Pack2D p)
Wrtie complementary information in a file. |
| Methods inherited from class opale.m2d.ker.Object2D |
getOIJ, readFile, setOIJ, writeFile, xmax |
| Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public double x
public double y
| Constructor Detail |
public Vector2D()
public Vector2D(OIJ rep)
OIJ - rep, the basis
public Vector2D(OIJ rep,
double x,
double y)
OIJ - rep, the basisdouble - x,y, coords of the vector.public Vector2D(Vector2D v)
Vector2D object.Vector2D - v, a vector.
public Vector2D(Point2D p,
Point2D q)
Point2D.Point2D - p, the originPoint2D - q, the end| Method Detail |
public final double getX()
public final double getY()
public final void setX(double x)
double - x, the new X coordinate.public final void setY(double y)
double - y, the new Y coordinate.
public final void set(double x,
double y)
x, - y, the coordinates of the vector.public final void set(Vector2D v)
Vector2D - v, the specified vector.public final double normSq()
public final double norm()
public static final double normSq(double x,
double y)
double - x,y, the coordinates of the vector.
public static double norm(double x,
double y)
double - x,y, the coordinates of the vector.public static double normSq(Vector2D v)
Vector2D - v, the vector.public static double norm(Vector2D v)
Vector2D - v, the vector.public boolean equals(java.lang.Object obj)
equals in class java.lang.ObjectObject - obj, an object to be compared with this vector.true the object to be compared is an instance of Vector2D and has the same value; false otherwise.public java.lang.Object clone()
clone in class Object2DOutOfMemoryError - if there is not enough memory.Cloneable
public void translate(double dx,
double dy)
Transformabletranslate in interface Transformableopale.m2d.ker.Transformabledouble - dx,dy, coordonées du vecteur de translation.public void rotate(double theta)
Transformablerotate in interface Transformableopale.m2d.ker.Transformabledouble - theta, l'angle de rotation en radian
public void rotate(double x,
double y,
double theta)
Transformablerotate in interface Transformableopale.m2d.ker.Transformabledouble - oriX, double oriY, le centre de la rotationdouble - theta, l'angle de rotation en radianpublic void transform(AffineTransform2D t)
TransformableAffineTransform.transform in interface Transformableopale.m2d.ker.TransformableAffineTransform, - the transformpublic void changeOIJ(OIJ rep)
changeOIJ in class Object2DOIJ - rep, le nouveau repere.public java.lang.String toString()
Object2DtoString in class Object2D
public void writeFileMore(WFile f,
Pack2D p)
Object2DwriteFileMore in class Object2Dopale.m2d.ker.Object2DWFile - f, the file in writing .
public int readKeyWord(java.lang.String word,
RFile f,
Pack2D p)
throws java.io.IOException,
MalformedFileException
Object2DreadKeyWord in class Object2Dopale.m2d.ker.Object2DString - word, the keyword.RFile - f, the file in reading.Pack2D - p, instance of Pack2D that contains the requiered objects.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||