ij3d.geom
Class Vector3D

java.lang.Object
  extended by ij3d.geom.Point3D
      extended by ij3d.geom.Vector3D

public class Vector3D
extends Point3D

Vecteur 3D

Author:
thomas

Constructor Summary
Vector3D()
          constructeurs
Vector3D(double x, double y, double z)
          Constructor for the Vector3D object
Vector3D(float x, float y, float z)
          Constructor for the Vector3D object
Vector3D(Point3D P)
           
Vector3D(Vector3D V)
          Copy constructor for the Vector3D object
 
Method Summary
 Vector3D add(Vector3D v)
          Add a vector
 Vector3D add(Vector3D v, double f1, double f2)
          Description of the Method
 Vector3D add(Vector3D v, float f1, float f2)
          add a vector with ration
 double angle(Vector3D v)
          angle between two vectors in radians between 0 and PI
 double angleDegrees(Vector3D v)
          angle between two vectors in degrees between 0 and 180
 Vector3D crossProduct(Vector3D V)
          the cross product between two vectors
 double distance(Vector3D V)
          Distance between two vectors
 double distanceSquare(Vector3D V)
          Description of the Method
 double getLength()
          Gets the value attribute of the Pixel3D object
 double getLength(double resXY, double resZ)
          Gets the length attribute of the Vector3D object with units
 Vector3D getPerpendicularVector()
           
 double intersection_unit_cube(double x, double y, double z, double rx, double ry, double rz)
          Distance traversée dans un cube (for projection computation)
 Vector3D multiply(double f)
          multiply a vector by a scalar
 Vector3D multiply(double fx, double fy, double fz)
          mumultiply the coordinates
 void normalize()
          normalization of the vector, put length to 1.0
 double scalarProduct(Vector3D Y)
          scalar product between two vectors
 void setCoord(double x, double y, double z)
          Sets the attributes of the Vector3D object
 java.lang.String toString()
          display vector information
 void xmlWrite(java.io.Writer wr)
           
 
Methods inherited from class ij3d.geom.Point3D
distance, distanceSquare, getPosition, getVector3D, getX, getY, getZ, setX, setY, setZ, translate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Vector3D

public Vector3D()
constructeurs


Vector3D

public Vector3D(float x,
                float y,
                float z)
Constructor for the Vector3D object

Parameters:
x - x coordinate of the vector
y - y coordinate of the vector
z - z coordinate of the vector

Vector3D

public Vector3D(double x,
                double y,
                double z)
Constructor for the Vector3D object

Parameters:
x - x coordinate of the vector
y - y coordinate of the vector
z - z coordinate of the vector

Vector3D

public Vector3D(Vector3D V)
Copy constructor for the Vector3D object

Parameters:
V - the vector to copy

Vector3D

public Vector3D(Point3D P)
Parameters:
P - the point3D to copy
Method Detail

setCoord

public void setCoord(double x,
                     double y,
                     double z)
Sets the attributes of the Vector3D object

Parameters:
x - x coordinate of the vector
y - y coordinate of the vector
z - z coordinate of the vector

getLength

public double getLength()
Gets the value attribute of the Pixel3D object

Returns:
The value value

getLength

public double getLength(double resXY,
                        double resZ)
Gets the length attribute of the Vector3D object with units

Parameters:
resXY - resolution in XY
resZ - resolution in Z
Returns:
The length value

distance

public double distance(Vector3D V)
Distance between two vectors

Parameters:
V - the other vector
Returns:
the length of the difference

distanceSquare

public double distanceSquare(Vector3D V)
Description of the Method

Parameters:
V - Description of the Parameter
Returns:
Description of the Return Value

add

public Vector3D add(Vector3D v)
Add a vector

Parameters:
v - the other vector
Returns:
the new vector

add

public Vector3D add(Vector3D v,
                    float f1,
                    float f2)
add a vector with ration

Parameters:
v - the other vector V2
f1 - the ratio for V1
f2 - the ratio for V2
Returns:
V1*f1 + V2*f2

add

public Vector3D add(Vector3D v,
                    double f1,
                    double f2)
Description of the Method

Parameters:
v - Description of the Parameter
f1 - Description of the Parameter
f2 - Description of the Parameter
Returns:
Description of the Return Value

multiply

public Vector3D multiply(double f)
multiply a vector by a scalar

Parameters:
f - the scalar
Returns:
the new vector multiplied

multiply

public Vector3D multiply(double fx,
                         double fy,
                         double fz)
mumultiply the coordinates

Parameters:
fx - multiplication factor for x
fy - multiplication factor for y
fz - multiplication factor for z
Returns:
the new vector

angle

public double angle(Vector3D v)
angle between two vectors in radians between 0 and PI

Parameters:
v - the other vector
Returns:
the angle

angleDegrees

public double angleDegrees(Vector3D v)
angle between two vectors in degrees between 0 and 180

Parameters:
v - the other vector
Returns:
the angle

scalarProduct

public double scalarProduct(Vector3D Y)
scalar product between two vectors

Parameters:
Y - the other vector
Returns:
this.Y

getPerpendicularVector

public Vector3D getPerpendicularVector()
Returns:
a random perpendicular vector

crossProduct

public Vector3D crossProduct(Vector3D V)
the cross product between two vectors

Parameters:
V - the other vector
Returns:
the result vector

normalize

public void normalize()
normalization of the vector, put length to 1.0


intersection_unit_cube

public double intersection_unit_cube(double x,
                                     double y,
                                     double z,
                                     double rx,
                                     double ry,
                                     double rz)
Distance traversée dans un cube (for projection computation)

Parameters:
rx - coordonnée x du point de passage
ry - coordonnée x du point de passage
rz - coordonnée x du point de passage
x - Description of the Parameter
y - Description of the Parameter
z - Description of the Parameter
Returns:
distance

toString

public java.lang.String toString()
display vector information

Overrides:
toString in class Point3D
Returns:
text

xmlWrite

public void xmlWrite(java.io.Writer wr)
Overrides:
xmlWrite in class Point3D
Parameters:
wr -