|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IVector
Provides access to vector properties and operations.
A general vector interface containing functions to manipulate vectors in an arbitrary number of dimensions. Contains basic vector characteristics including Dimension and Magnitude as well as general vector operations including Normalization, scalar nultiplication, Vector Addition, Vector Subtraction, Vector Dot Product, and Vector Cross Product. To access methods specific to 3D Vectors, use the IVector3D interface.
Method Summary | |
---|---|
IVector |
addVector(IVector otherVector)
Construct a new vector by adding a different vector to this vector. |
void |
constructAddVector(IVector vector1,
IVector vector2)
Set this vector by adding two input vectors. |
void |
constructSubtractVector(IVector vector1,
IVector vector2)
Set this vector by subtracting the second input vector from the first one. |
double |
dotProduct(IVector otherVector)
Returns the dot product of this vector and another vector. |
double |
getComponentByIndex(int componentIndex)
The component corresponding to a given index. |
int |
getDimension()
The dimension of this vector. |
double |
getMagnitude()
The length of the vector. |
boolean |
isEmpty()
Indicates if the vector is empty (unset). |
void |
normalize()
Normalize the vector (scale it to magnitude = 1). |
void |
scale(double scaleFactor)
Scale the vector by the given factor. |
void |
setComponentByIndex(int componentIndex,
double componentValue)
The component corresponding to a given index. |
void |
setEmpty()
Makes the vector empty (unset). |
void |
setMagnitude(double magnitude)
The length of the vector. |
IVector |
subtractVector(IVector otherVector)
Construct a new vector by subtracting a different vector from this vector. |
Method Detail |
---|
int getDimension() throws IOException, AutomationException
Returns the Dimension of the Vector. The Dimension corresponds to the number of unique Components that define the vector.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.boolean isEmpty() throws IOException, AutomationException
Returns TRUE if all of the components of the vector have undefined (NaN) values. An Empty vector is NOT the same as a Null vector.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void setEmpty() throws IOException, AutomationException
Sets the vector equal to an empty vector in which all components have undefined (NaN) values.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.double getComponentByIndex(int componentIndex) throws IOException, AutomationException
componentIndex
- The componentIndex (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void setComponentByIndex(int componentIndex, double componentValue) throws IOException, AutomationException
Sets the value of the component of the specified index equal to the input component value. The first component has index 0. An Nth Dimensional vector has N components (0, 1, . . ., N-2, N-1).
componentIndex
- The componentIndex (in)componentValue
- The componentValue (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.double getMagnitude() throws IOException, AutomationException
Returns and sets the magnitude of the vector. The magnitude is analgous to the length of the vector.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void setMagnitude(double magnitude) throws IOException, AutomationException
magnitude
- The magnitude (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void normalize() throws IOException, AutomationException
Normalizes the Vector to a unit vector with Magnitude = 1 and the same direction as the original vector.
Normalize is the same as Scaling the vector by 1 / Magnitude.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void scale(double scaleFactor) throws IOException, AutomationException
Multiplies each component of the Vector by a given Scale factor. If the scale factor is positive, the resulting scaled vector has the same direction as the original vector. If the scale factor is negative, the resulting scaled vector has the opposite direction as the original vector. The Magnitude of the scaled vector = OriginalMagnitude * Abs(ScaleFactor).
Scaling a Vector by 1 / Magnitude effectively Normalizes the vector and results in a unit vector.
scaleFactor
- The scaleFactor (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IVector addVector(IVector otherVector) throws IOException, AutomationException
Returns a newly constructed Vector by adding the components of the base vector to the corresponding components of the input vector.
otherVector
- A reference to a com.esri.arcgis.geometry.IVector (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IVector subtractVector(IVector otherVector) throws IOException, AutomationException
Returns a newly constructed Vector by subtracting the components of the input vector from the corresponding components of the base vector.
otherVector
- A reference to a com.esri.arcgis.geometry.IVector (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void constructAddVector(IVector vector1, IVector vector2) throws IOException, AutomationException
Constructs a new Vector by adding the components of the first vector to the corresponding components of the second vector.
vector1
- A reference to a com.esri.arcgis.geometry.IVector (in)vector2
- A reference to a com.esri.arcgis.geometry.IVector (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void constructSubtractVector(IVector vector1, IVector vector2) throws IOException, AutomationException
Constructs a new Vector by subtracting the components of the second vector from the corresponding components of the first vector.
vector1
- A reference to a com.esri.arcgis.geometry.IVector (in)vector2
- A reference to a com.esri.arcgis.geometry.IVector (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.double dotProduct(IVector otherVector) throws IOException, AutomationException
Returns a double representing the Dot Product of the base vector and the input vector. The Dot Product is the sum of multiplying corresponding components of each vector.
otherVector
- A reference to a com.esri.arcgis.geometry.IVector (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |