JNISpice
version 2.0.0

spice.basic
Class Vector6

java.lang.Object
  extended by spice.basic.Vector6
Direct Known Subclasses:
StateVector

public class Vector6
extends java.lang.Object

Class Vector6 represents six-dimensional, double precision vectors. This class provides the common mathematical operations applicable to state vectors.

Version 1.0.0 22-DEC-2009 (NJB)


Constructor Summary
Vector6()
          Construct a zero-filled Vector6.
Vector6(double[] vin)
          Construct a Vector6 from an array of 6 doubles.
Vector6(double s0, double s1, double s2, double s3, double s4, double s5)
          Construct a Vector6 from 6 double scalars.
Vector6(Vector3 v1, Vector3 v2)
          Construct a Vector6 from two three-vectors.
Vector6(Vector6 vin)
          Copy constructor: create a Vector6 from another.
 
Method Summary
 Vector6 add(Vector6 v2)
          Add a Vector6 instance to this instance.
 void assign(double[] values)
          Assign to a Vector6 instance the contents of an array of 6 doubles.
 Vector6 dcross(Vector6 s2)
          Return the cross product and corresponding derivative defined by two state vectors, where the state vectors are represented by this and a second Vector6 instance.
 double ddot(Vector6 s2)
          Return the derivative of the dot product of the position components of two state vectors, where the state vectors are represented by this and a second Vector6 instance.
 Vector6 dhat()
          Return the unit-length vector and corresponding derivative defined by a state vector, where the state vector is represented by this instance.
 double dist(Vector6 v2)
          Return the distance between this and a second Vector6 instance.
 double dot(Vector6 v2)
          Return the dot product of this and a second Vector6 instance.
 double dsep(Vector6 s2)
          Return the derivative of the angular separation of the position components of two state vectors, where the state vectors are represented by this and a second Vector6 instance.
 double getElt(int i)
          Return the element of this instance at index [i].
 Vector3 getVector3(int i)
          Regarding this instance as an array of two 3-vectors, return the specified 3-vector.
 boolean isZero()
          Indicate whether a Vector6 instance is the zero vector.
static Vector6 lcom(double a, Vector6 v1, double b, Vector6 v2)
          Compute a vector linear combination of two Vector6 instances.
 Vector6 negate()
          Negate a Vector6 instance, returning a new instance.
 double norm()
          Return the vector (L2) norm of this instance.
 Vector6 scale(double s)
          Scale a Vector6 instance, creating a new instance.
 Vector6 sub(Vector6 v2)
          Subtract a Vector6 instance from this instance.
 double[] toArray()
          Return the contents of a Vector6 in an array of 6 doubles.
 java.lang.String toString()
          Return a string representation of the contents of a Vector6.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Vector6

public Vector6()
Construct a zero-filled Vector6.


Vector6

public Vector6(Vector6 vin)
Copy constructor: create a Vector6 from another.


Vector6

public Vector6(double s0,
               double s1,
               double s2,
               double s3,
               double s4,
               double s5)
Construct a Vector6 from 6 double scalars.


Vector6

public Vector6(double[] vin)
        throws SpiceException
Construct a Vector6 from an array of 6 doubles.

Throws:
SpiceException

Vector6

public Vector6(Vector3 v1,
               Vector3 v2)
Construct a Vector6 from two three-vectors.

Method Detail

add

public Vector6 add(Vector6 v2)
Add a Vector6 instance to this instance.


assign

public void assign(double[] values)
            throws SpiceException
Assign to a Vector6 instance the contents of an array of 6 doubles.

Throws:
SpiceException

dcross

public Vector6 dcross(Vector6 s2)
               throws SpiceException
Return the cross product and corresponding derivative defined by two state vectors, where the state vectors are represented by this and a second Vector6 instance.

Throws:
SpiceException

ddot

public double ddot(Vector6 s2)
            throws SpiceException
Return the derivative of the dot product of the position components of two state vectors, where the state vectors are represented by this and a second Vector6 instance.

Throws:
SpiceException

dhat

public Vector6 dhat()
             throws SpiceException
Return the unit-length vector and corresponding derivative defined by a state vector, where the state vector is represented by this instance.

Throws:
SpiceException

dist

public double dist(Vector6 v2)
Return the distance between this and a second Vector6 instance.


dot

public double dot(Vector6 v2)
           throws SpiceException
Return the dot product of this and a second Vector6 instance.

Throws:
SpiceException

dsep

public double dsep(Vector6 s2)
            throws SpiceException
Return the derivative of the angular separation of the position components of two state vectors, where the state vectors are represented by this and a second Vector6 instance.

Throws:
SpiceException

getElt

public double getElt(int i)
              throws SpiceException
Return the element of this instance at index [i].

Throws:
SpiceException

getVector3

public Vector3 getVector3(int i)
                   throws SpiceException
Regarding this instance as an array of two 3-vectors, return the specified 3-vector.

Throws:
SpiceException

isZero

public boolean isZero()
Indicate whether a Vector6 instance is the zero vector.


lcom

public static Vector6 lcom(double a,
                           Vector6 v1,
                           double b,
                           Vector6 v2)
Compute a vector linear combination of two Vector6 instances.


negate

public Vector6 negate()
Negate a Vector6 instance, returning a new instance.


norm

public double norm()
Return the vector (L2) norm of this instance.


scale

public Vector6 scale(double s)
Scale a Vector6 instance, creating a new instance.


sub

public Vector6 sub(Vector6 v2)
Subtract a Vector6 instance from this instance.


toArray

public double[] toArray()
Return the contents of a Vector6 in an array of 6 doubles.


toString

public java.lang.String toString()
Return a string representation of the contents of a Vector6. This overrides Object's toString method.

Overrides:
toString in class java.lang.Object

JNISpice
version 2.0.0

JNISpice Alpha Test Version 2.0.0 28-JAN-2017 (NJB)