GeoSoft API

no.geosoft.cc.geometry
Class Vector4

Object
  |
  +--Vector4

public class Vector4
extends Object

Implementation of a 4-element vector suited for use with Matrix4x4

Author:
GeoSoft

Constructor Summary
Vector4()
          Create a default 4-element vector (all elements set to 0.0).
Vector4(double v1, double v2, double v3, double v4)
          Create a 4-element vector with the specified values.
Vector4(Vector4 vector4)
          Construct a 4-element vector as a copy of the specified vector.
 
Method Summary
 boolean equals(Object object)
          Check if this 4-element vector equals the specified object.
 double getElement(int i)
          Return the i'th element of this vector.
 void set(double v1, double v2, double v3, double v4)
          Set the elements of this vector.
 void set(Vector4 vector)
          Set the elements of this vector according to the specified vector.
 void setElement(int i, double value)
          Set the i'th element of this vector.
 String toString()
          Create a string representation of this vector.
 
Methods inherited from class Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Vector4

public Vector4()
Create a default 4-element vector (all elements set to 0.0).


Vector4

public Vector4(double v1,
               double v2,
               double v3,
               double v4)
Create a 4-element vector with the specified values.

Parameters:
v1 - 1st element.
v2 - 2nd element.
v3 - 3rd element.
v4 - 4th element

Vector4

public Vector4(Vector4 vector4)
Construct a 4-element vector as a copy of the specified vector.

Parameters:
vector4 -
Method Detail

set

public void set(double v1,
                double v2,
                double v3,
                double v4)
Set the elements of this vector.

Parameters:
v1 - 1st element.
v2 - 2nd element.
v3 - 3rd element.
v4 - 4th element

set

public void set(Vector4 vector)
Set the elements of this vector according to the specified vector.

Parameters:
vector - Vector to copy.

equals

public boolean equals(Object object)
Check if this 4-element vector equals the specified object.

Overrides:
equals in class Object
Returns:
TRue if the two equals, false otherwise.

getElement

public double getElement(int i)
Return the i'th element of this vector.

Parameters:
i - Index of element to get (first is 0).
Returns:
i'th element of this vector.

setElement

public void setElement(int i,
                       double value)
Set the i'th element of this vector.

Parameters:
i - Index of element to set (first is 0).

toString

public String toString()
Create a string representation of this vector.

Overrides:
toString in class Object
Returns:
String representing this vector.

GeoSoft API

Copyright © 2004 - Geotechnical Software Services     geosoft.no