VeaR/JEllipse

pl.krakow.cmuj.bioinformatics.jellipse.mathtoolkit
Class Vector3

java.lang.Object
  extended by pl.krakow.cmuj.bioinformatics.jellipse.mathtoolkit.Vector3

public class Vector3
extends java.lang.Object


Field Summary
private  float[] v
           
 
Constructor Summary
Vector3()
           
Vector3(float[] vec)
           
Vector3(float v0, float v1, float v2)
           
Vector3(Vector3 vec)
           
 
Method Summary
 Vector3 add(Vector3 vec)
          adds a vectors to the current one (doesn't alter existing vectors)
 void addToMe(Vector3 vec)
          adds a vector to the current one (and alters it!)
 Vector3 cross(Vector3 vec)
          performs cross multiplication on current and given vectors (doesn't alter existing vectors)
static Vector3 cross(Vector3 v1, Vector3 v2)
          perform cross multiplication on vectors (and doesn't alter any existing)
 void crossMe(Vector3 vec)
          performs cross multiplication on current and given vectors (alters current one!)
 float dot(Vector3 vec)
          performs inner ("dot") multiplication on vectors
 void get(float[] vec)
           
 void get(float v0, float v1, float v2)
           
 float get(int index)
           
 void get(Vector3 vec)
           
 void negate()
           
static Vector3 negate(Vector3 vec)
           
 float norm()
          calculates norm of the current vector
 Vector3 normalize()
          normalizes current vector (doesn't alter it!)
 void normalizeMe()
          normalizes current vector (alters it!)
 void nullify()
           
 Vector3 scale(float s)
          performs multiplication of vector by number (scaling) (doesn't alter any existing vectors)
 void scaleMe(float s)
          multiplies current vector by a number (and alters it!)
 void set(float[] vec)
           
 void set(float v0, float v1, float v2)
           
 void set(int index, float value)
           
 void set(Vector3 vec)
           
 Vector3 subtr(Vector3 vec)
          subtracts a given vector from the current one (doesn't alter any existing vectors) current vector is minuend
 void subtrFromMe(Vector3 vec)
          subtracts a given vector from the current one (and alters it!)
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

v

private float[] v
Constructor Detail

Vector3

public Vector3()

Vector3

public Vector3(float v0,
               float v1,
               float v2)

Vector3

public Vector3(float[] vec)

Vector3

public Vector3(Vector3 vec)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

set

public void set(float v0,
                float v1,
                float v2)

set

public void set(int index,
                float value)

set

public void set(float[] vec)

set

public void set(Vector3 vec)

get

public void get(float v0,
                float v1,
                float v2)

get

public float get(int index)

get

public void get(float[] vec)

get

public void get(Vector3 vec)

nullify

public void nullify()

negate

public void negate()

negate

public static Vector3 negate(Vector3 vec)

addToMe

public void addToMe(Vector3 vec)
adds a vector to the current one (and alters it!)

Parameters:
vec - another vector

add

public Vector3 add(Vector3 vec)
adds a vectors to the current one (doesn't alter existing vectors)

Parameters:
vec - another vector
Returns:
sum of two vectors as new Vector3

subtrFromMe

public void subtrFromMe(Vector3 vec)
subtracts a given vector from the current one (and alters it!)

Parameters:
vec - subtrahend vector

subtr

public Vector3 subtr(Vector3 vec)
subtracts a given vector from the current one (doesn't alter any existing vectors) current vector is minuend

Parameters:
vec - subtrahend vector
Returns:
new vector as the result of subtraction

scaleMe

public void scaleMe(float s)
multiplies current vector by a number (and alters it!)

Parameters:
s - ("coefficient")

scale

public Vector3 scale(float s)
performs multiplication of vector by number (scaling) (doesn't alter any existing vectors)

Parameters:
s - ("coefficient")
Returns:
new scaled vector

dot

public float dot(Vector3 vec)
performs inner ("dot") multiplication on vectors

Parameters:
vec - another vector
Returns:
dot product of the current vector and the given

crossMe

public void crossMe(Vector3 vec)
performs cross multiplication on current and given vectors (alters current one!)

Parameters:
vec - right-hand/second vector

cross

public Vector3 cross(Vector3 vec)
performs cross multiplication on current and given vectors (doesn't alter existing vectors)

Parameters:
vec - right-hand/second vector
Returns:
cross product of the current and given vectors

cross

public static Vector3 cross(Vector3 v1,
                            Vector3 v2)
perform cross multiplication on vectors (and doesn't alter any existing)

Parameters:
v1 - left/first vector
v2 - right/second vector
Returns:
cross product of two vectors

normalizeMe

public void normalizeMe()
normalizes current vector (alters it!)


normalize

public Vector3 normalize()
normalizes current vector (doesn't alter it!)

Returns:
normalized current vector as a new one

norm

public float norm()
calculates norm of the current vector

Returns:
norm (length) of the current vector

VeaR/JEllipse