com.esri.arcgis.geometry
Interface IVector

All Superinterfaces:
Serializable
All Known Subinterfaces:
IVector3D
All Known Implementing Classes:
Vector3D

public interface IVector
extends Serializable

Provides access to vector properties and operations.

Description

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.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.


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

getDimension

int getDimension()
                 throws IOException,
                        AutomationException
The dimension of this vector.

Description

Returns the Dimension of the Vector. The Dimension corresponds to the number of unique Components that define the vector.

Remarks

Vector Dimension Example

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
The dimension
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isEmpty

boolean isEmpty()
                throws IOException,
                       AutomationException
Indicates if the vector is empty (unset).

Description

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.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
The isEmpty
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setEmpty

void setEmpty()
              throws IOException,
                     AutomationException
Makes the vector empty (unset).

Description

Sets the vector equal to an empty vector in which all components have undefined (NaN) values.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getComponentByIndex

double getComponentByIndex(int componentIndex)
                           throws IOException,
                                  AutomationException
The component corresponding to a given index.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
componentIndex - The componentIndex (in)
Returns:
The componentValue
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setComponentByIndex

void setComponentByIndex(int componentIndex,
                         double componentValue)
                         throws IOException,
                                AutomationException
The component corresponding to a given index.

Description

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).

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
componentIndex - The componentIndex (in)
componentValue - The componentValue (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getMagnitude

double getMagnitude()
                    throws IOException,
                           AutomationException
The length of the vector.

Description

Returns and sets the magnitude of the vector. The magnitude is analgous to the length of the vector.

Remarks

IVector Magnitude Example

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
The magnitude
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setMagnitude

void setMagnitude(double magnitude)
                  throws IOException,
                         AutomationException
The length of the vector.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
magnitude - The magnitude (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

normalize

void normalize()
               throws IOException,
                      AutomationException
Normalize the vector (scale it to magnitude = 1).

Description

Normalizes the Vector to a unit vector with Magnitude = 1 and the same direction as the original vector.

Remarks

Normalize is the same as Scaling the vector by 1 / Magnitude.

IVector Normalize Example

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

scale

void scale(double scaleFactor)
           throws IOException,
                  AutomationException
Scale the vector by the given factor.

Description

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).

Remarks

Scaling a Vector by 1 / Magnitude effectively Normalizes the vector and results in a unit vector.

IVector Scale Example

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
scaleFactor - The scaleFactor (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addVector

IVector addVector(IVector otherVector)
                  throws IOException,
                         AutomationException
Construct a new vector by adding a different vector to this vector.

Description

Returns a newly constructed Vector by adding the components of the base vector to the corresponding components of the input vector.

Remarks

IVector AddVector Example

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
otherVector - A reference to a com.esri.arcgis.geometry.IVector (in)
Returns:
A reference to a com.esri.arcgis.geometry.IVector
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

subtractVector

IVector subtractVector(IVector otherVector)
                       throws IOException,
                              AutomationException
Construct a new vector by subtracting a different vector from this vector.

Description

Returns a newly constructed Vector by subtracting the components of the input vector from the corresponding components of the base vector.

Remarks

IVector SubtractVector Example

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
otherVector - A reference to a com.esri.arcgis.geometry.IVector (in)
Returns:
A reference to a com.esri.arcgis.geometry.IVector
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

constructAddVector

void constructAddVector(IVector vector1,
                        IVector vector2)
                        throws IOException,
                               AutomationException
Set this vector by adding two input vectors.

Description

Constructs a new Vector by adding the components of the first vector to the corresponding components of the second vector.

Remarks

IVector ConstructAddVector Example

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
vector1 - A reference to a com.esri.arcgis.geometry.IVector (in)
vector2 - A reference to a com.esri.arcgis.geometry.IVector (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

constructSubtractVector

void constructSubtractVector(IVector vector1,
                             IVector vector2)
                             throws IOException,
                                    AutomationException
Set this vector by subtracting the second input vector from the first one.

Description

Constructs a new Vector by subtracting the components of the second vector from the corresponding components of the first vector.

Remarks

IVector ConstructSubtractVector Example

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
vector1 - A reference to a com.esri.arcgis.geometry.IVector (in)
vector2 - A reference to a com.esri.arcgis.geometry.IVector (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

dotProduct

double dotProduct(IVector otherVector)
                  throws IOException,
                         AutomationException
Returns the dot product of this vector and another vector.

Description

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.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
otherVector - A reference to a com.esri.arcgis.geometry.IVector (in)
Returns:
The result
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.