JavaView® v2.12

jv.vecmath
Class PdBaryDir

java.lang.Object
  |
  +--jv.vecmath.P_Vector
        |
        +--jv.vecmath.PdBaryDir
All Implemented Interfaces:
java.io.Serializable

public class PdBaryDir
extends P_Vector

Barycentric tangent vector of arbitrary dimension, sum of entries must be 0. Internal array length is equal to barycentric dimension.

Version:
08.11.00, 1.30 revised (kp) Replace string formatting routines of Fmt with PuString.
28.08.00, 1.20 revised (ep) Method sub(PdBary,PdBary) added.
13.07.99, 1.10 revised (ep) Method multScalar() added.
09.06.99, 1.00 created (kp)
Author:
Konrad Polthier
See Also:
Serialized Form

Field Summary
 double[] m_data
          Array with barycentric coordinates, sum of entries must be 1.
 
Constructor Summary
PdBaryDir()
          Construct empty class.
PdBaryDir(double x, double y)
          Construct class with dimension=2 and given initial values.
PdBaryDir(double x, double y, double z)
          Construct class with dimension=3 and given initial values.
PdBaryDir(double x, double y, double z, double w)
          Construct class with dimension=4 and given initial values.
PdBaryDir(int aSize)
          Construct class with given dimension.
 
Method Summary
 java.lang.Object clone()
          Duplicate vector and data array.
 void copy(PdBaryDir vec)
          Copies argument vector into 'this', and possibly adjusts size of 'this'.
static PdBaryDir copyNew(PdBaryDir v)
          Create a new vector as clone of argument vector.
 int getSize()
          Get dimension of barycentric vector.
static void getVector(PdVector p, PdBaryDir bary, PdVector v0, PdVector v1, PdVector v2)
          Get vector from barycentric direction in a triangle.
 void multScalar(double scalar)
          Multiply all components with scalar.
 int setSize(int aSize)
          Set dimension of barycentric vector, i.e. length of its data array.
 void sub(PdBary x, PdBary y)
           
 java.lang.String toShortString()
          Create a single-line string representation of the vector components and attributes.
 java.lang.String toString()
          Create a multi-line string representation with detailed information about all instance variables.
 void validate()
          Check sum of barycentric coordinates, and adjust if sum is not zero.
 
Methods inherited from class jv.vecmath.P_Vector
clearTag, clone, clone, copy, getBits, getName, hasTag, setName, setTag
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_data

public double[] m_data
Array with barycentric coordinates, sum of entries must be 1. Length is equal to barycentric dimension.
Constructor Detail

PdBaryDir

public PdBaryDir()
Construct empty class.

PdBaryDir

public PdBaryDir(int aSize)
Construct class with given dimension.

PdBaryDir

public PdBaryDir(double x,
                 double y)
Construct class with dimension=2 and given initial values.

PdBaryDir

public PdBaryDir(double x,
                 double y,
                 double z)
Construct class with dimension=3 and given initial values.

PdBaryDir

public PdBaryDir(double x,
                 double y,
                 double z,
                 double w)
Construct class with dimension=4 and given initial values.
Method Detail

toString

public java.lang.String toString()
Create a multi-line string representation with detailed information about all instance variables.
Overrides:
toString in class P_Vector
See Also:
toShortString()

toShortString

public java.lang.String toShortString()
Create a single-line string representation of the vector components and attributes.
See Also:
toString()

clone

public java.lang.Object clone()
Duplicate vector and data array. Method just returns result of copyNew(PdBaryDir).
See Also:
copyNew(PdBaryDir)

copyNew

public static PdBaryDir copyNew(PdBaryDir v)
Create a new vector as clone of argument vector.
Parameters:
v - source vector to clone

copy

public void copy(PdBaryDir vec)
Copies argument vector into 'this', and possibly adjusts size of 'this'.
Parameters:
vec - the vector to be copied

getSize

public int getSize()
Get dimension of barycentric vector.

setSize

public int setSize(int aSize)
Set dimension of barycentric vector, i.e. length of its data array.
Parameters:
new - number of components of vector
Returns:
new number of components of vector

validate

public void validate()
Check sum of barycentric coordinates, and adjust if sum is not zero.

multScalar

public void multScalar(double scalar)
Multiply all components with scalar.

getVector

public static void getVector(PdVector p,
                             PdBaryDir bary,
                             PdVector v0,
                             PdVector v1,
                             PdVector v2)
Get vector from barycentric direction in a triangle.

sub

public void sub(PdBary x,
                PdBary y)
Returns:
this = x-y

JavaView® v2.12

The software JavaView® is copyright protected. All Rights Reserved.