spis.Util.Vect
Class Vect

java.lang.Object
  extended byspis.Util.Vect.Vect

public final class Vect
extends java.lang.Object

Class Name : Vect
Project ref : SPIS project
File name : Vect.java
File type : class
Copyright : ONERA, 2 Av. E. Belin, 31055 Toulouse cedex, France http://www.onecert.fr
Status : under development
Creation : 25/08/2003
Modification :

Description : Vector computation functions (vectors as float[dim] of arbitrary dimension dim, except for vector product).

Versions and anomalies correction :

Version numberAuthor (name, e-mail) Corrections/Modifications
0.1 JF Roussel, roussel@onecert.frCreation


Version:
0.1
Author:
JF Roussel

Constructor Summary
Vect()
           
 
Method Summary
static float[] diff(float[] v1, float[] v2)
          returns the difference of two vectors
static float distToLine(float[] p, float[] p1, float[] p2)
           
static float[] linComb(float[] v1, float x1, float[] v2, float x2)
          returns the linear combination of two vectors
static float[] linComb(float[] v1, float x1, float[] v2, float x2, float[] v3, float x3)
          returns the linear combination of three vectors
static float[] linComb(float[] v1, float x1, float[] v2, float x2, float[] v3, float x3, float[] v4, float x4)
          returns the linear combination of four vectors
static float mixtProd(float[] v1, float[] v2, float[] v3)
          returns the mixt product of three vectors (3D only, not checked)
static void mult(float[] v, float x)
          multiplies a vector by a scalar
static float norm(float[] v)
          returns a vector norm
static void normalise(float[] v)
          normalises a vector
static float scalProd(float[] v1, float[] v2)
          returns the scalar product, or dot product, of two vectors
static float sqr(float[] v)
          returns the scalar product, or dot product, of two vectors
static float[] sum(float[] v1, float[] v2)
          returns the sum of two vectors
static float[] vectProd(float[] v1, float[] v2)
          returns the vector product of two vectors (3D only, not checked)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Vect

public Vect()
Method Detail

scalProd

public static float scalProd(float[] v1,
                             float[] v2)
returns the scalar product, or dot product, of two vectors


sqr

public static float sqr(float[] v)
returns the scalar product, or dot product, of two vectors


diff

public static float[] diff(float[] v1,
                           float[] v2)
returns the difference of two vectors

Parameters:
v1 -
v2 -
Returns:
v1-v2

sum

public static float[] sum(float[] v1,
                          float[] v2)
returns the sum of two vectors


linComb

public static float[] linComb(float[] v1,
                              float x1,
                              float[] v2,
                              float x2)
returns the linear combination of two vectors


linComb

public static float[] linComb(float[] v1,
                              float x1,
                              float[] v2,
                              float x2,
                              float[] v3,
                              float x3)
returns the linear combination of three vectors


linComb

public static float[] linComb(float[] v1,
                              float x1,
                              float[] v2,
                              float x2,
                              float[] v3,
                              float x3,
                              float[] v4,
                              float x4)
returns the linear combination of four vectors


vectProd

public static float[] vectProd(float[] v1,
                               float[] v2)
returns the vector product of two vectors (3D only, not checked)


mixtProd

public static float mixtProd(float[] v1,
                             float[] v2,
                             float[] v3)
returns the mixt product of three vectors (3D only, not checked)


normalise

public static void normalise(float[] v)
normalises a vector


mult

public static void mult(float[] v,
                        float x)
multiplies a vector by a scalar


norm

public static float norm(float[] v)
returns a vector norm


distToLine

public static float distToLine(float[] p,
                               float[] p1,
                               float[] p2)
Parameters:
p -
p1 -
p2 -
Returns:
the distance from point p to straight line defined by points p1 and p2