vtk
Class vtkMath

java.lang.Object
  extended byvtk.vtkObjectBase
      extended byvtk.vtkObject
          extended byvtk.vtkMath
All Implemented Interfaces:
java.io.Serializable

public class vtkMath
extends vtkObject
implements java.io.Serializable

vtkMath - performs common math operations. vtkMath is provides methods to perform common math operations. These include providing constants such as Pi; conversion from degrees to radians; vector operations such as dot and cross products and vector norm; matrix determinant for 2x2 and 3x3 matrices; and random number generation. JavaBean wrapper for vtkMath object.

Author:
vtk2jbean Automatic JavaBean wrapper for VTK.
See Also:
Serialized Form

Field Summary
protected  java.beans.PropertyChangeSupport changes
           
 
Fields inherited from class vtk.vtkObjectBase
vtkId
 
Constructor Summary
  vtkMath()
           
protected vtkMath(int dmy)
           
 
Method Summary
 int areBoundsInitialized(double[] id0)
           
 void cross(double[] id0, double[] id1, double[] id2)
          Cross product of two 3-vectors.
 double degreesToRadians()
          Useful constants.
 double determinant2x2(double[] id0, double[] id1)
          Compute determinant of 2x2 matrix.
 double determinant2x2(double id0, double id1, double id2, double id3)
          Calculate the determinant of a 2x2 matrix: | a b | | c d |
 double determinant3x3(double[] id0, double[] id1, double[] id2)
          Compute determinant of 3x3 matrix.
 double determinant3x3(double id0, double id1, double id2, double id3, double id4, double id5, double id6, double id7, double id8)
          Calculate the determinant of a 3x3 matrix in the form: | a1, b1, c1 | | a2, b2, c2 | | a3, b3, c3 |
 double distance2BetweenPoints(double[] id0, double[] id1)
          Compute distance squared between two points.
 double dot(double[] id0, double[] id1)
          Dot product of two 3-vectors (float version).
 double dot2D(double[] id0, double[] id1)
          Dot product of two 2-vectors.
 double doubleDegreesToRadians()
          Useful constants.
 double doublePi()
          Useful constants.
 double doubleRadiansToDegrees()
          Useful constants.
 int floor(double id0)
           
 java.lang.String getClassName()
          Return the class name as a string.
 vtkMath getThisMath()
           
 void hSVToRGB(double[] id0, double[] id1)
          Convert color in HSV format (Hue, Saturation, Value) to RGB format (Red, Green, Blue).
 int isA(java.lang.String id0)
          Return 1 if this class is the same type of (or a subclass of) the named class.
 double norm(double[] id0)
          Compute the norm of 3-vector.
 double norm2D(double[] id0)
          Compute the norm of a 2-vector.
 double normalize(double[] id0)
          Normalize (in place) a 3-vector.
 double normalize2D(double[] id0)
          Normalize (in place) a 2-vector.
 void perpendiculars(double[] id0, double[] id1, double[] id2, double id3)
          Given a unit vector x, find two unit vectors y and z such that x cross y = z (i.e. the vectors are perpendicular to each other).
 double pi()
          Useful constants.
 double radiansToDegrees()
          Useful constants.
 double random()
          Generate random numbers between 0.0 and 1.0.
 double random(double id0, double id1)
          Generate random number between (min,max).
 void randomSeed(int id0)
          Initialize seed value.
 void rGBToHSV(double[] id0, double[] id1)
          Convert color in RGB format (Red, Green, Blue) to HSV format (Hue, Saturation, Value).
 int round(double id0)
          Rounds a float to the nearest integer.
 void uninitializeBounds(double[] id0)
          Are the bounds initialized?
protected  void VTKCastInit()
           
 void VTKInit()
           
 
Methods inherited from class vtk.vtkObject
AddObserver, breakOnError, debugOff, debugOn, getDebug, getGlobalWarningDisplay, getMTime, getThisObject, globalWarningDisplayOff, globalWarningDisplayOn, hasObserver, hasObserver, invokeEvent, invokeEvent, modified, Print, PrintRevisions, register, removeObserver, removeObservers, removeObservers, setDebug, setGlobalWarningDisplay, unRegister
 
Methods inherited from class vtk.vtkObjectBase
addPropertyChangeListener, finalize, getReferenceCount, getThisObjectBase, isTypeOf, removePropertyChangeListener, setReferenceCount, VTKDelete
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

changes

protected java.beans.PropertyChangeSupport changes
Constructor Detail

vtkMath

public vtkMath()

vtkMath

protected vtkMath(int dmy)
Method Detail

getThisMath

public vtkMath getThisMath()

getClassName

public java.lang.String getClassName()
Description copied from class: vtkObjectBase
Return the class name as a string. This method is defined in all subclasses of vtkObjectBase with the vtkTypeRevisionMacro found in vtkSetGet.h.

Overrides:
getClassName in class vtkObject

isA

public int isA(java.lang.String id0)
Description copied from class: vtkObjectBase
Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeRevisionMacro found in vtkSetGet.h.

Overrides:
isA in class vtkObject

pi

public double pi()
Useful constants.


degreesToRadians

public double degreesToRadians()
Useful constants.


radiansToDegrees

public double radiansToDegrees()
Useful constants.


doubleDegreesToRadians

public double doubleDegreesToRadians()
Useful constants. (double-precision version)


doublePi

public double doublePi()
Useful constants. (double-precision version)


doubleRadiansToDegrees

public double doubleRadiansToDegrees()
Useful constants. (double-precision version)


round

public int round(double id0)
Rounds a float to the nearest integer.


floor

public int floor(double id0)

dot

public double dot(double[] id0,
                  double[] id1)
Dot product of two 3-vectors (float version).


cross

public void cross(double[] id0,
                  double[] id1,
                  double[] id2)
Cross product of two 3-vectors. Result vector in z[3].


norm

public double norm(double[] id0)
Compute the norm of 3-vector.


normalize

public double normalize(double[] id0)
Normalize (in place) a 3-vector. Returns norm of vector.


perpendiculars

public void perpendiculars(double[] id0,
                           double[] id1,
                           double[] id2,
                           double id3)
Given a unit vector x, find two unit vectors y and z such that x cross y = z (i.e. the vectors are perpendicular to each other). There is an infinite number of such vectors, specify an angle theta to choose one set. If you want only one perpendicular vector, specify NULL for z.


distance2BetweenPoints

public double distance2BetweenPoints(double[] id0,
                                     double[] id1)
Compute distance squared between two points.


dot2D

public double dot2D(double[] id0,
                    double[] id1)
Dot product of two 2-vectors. The third (z) component is ignored.


norm2D

public double norm2D(double[] id0)
Compute the norm of a 2-vector. Ignores z-component.


normalize2D

public double normalize2D(double[] id0)
Normalize (in place) a 2-vector. Returns norm of vector. Ignores z-component.


determinant2x2

public double determinant2x2(double[] id0,
                             double[] id1)
Compute determinant of 2x2 matrix. Two columns of matrix are input.


determinant2x2

public double determinant2x2(double id0,
                             double id1,
                             double id2,
                             double id3)
Calculate the determinant of a 2x2 matrix: | a b | | c d |


determinant3x3

public double determinant3x3(double[] id0,
                             double[] id1,
                             double[] id2)
Compute determinant of 3x3 matrix. Three columns of matrix are input.


determinant3x3

public double determinant3x3(double id0,
                             double id1,
                             double id2,
                             double id3,
                             double id4,
                             double id5,
                             double id6,
                             double id7,
                             double id8)
Calculate the determinant of a 3x3 matrix in the form: | a1, b1, c1 | | a2, b2, c2 | | a3, b3, c3 |


randomSeed

public void randomSeed(int id0)
Initialize seed value. NOTE: Random() has the bad property that the first random number returned after RandomSeed() is called is proportional to the seed value! To help solve this, call RandomSeed() a few times inside seed. This doesn't ruin the repeatability of Random().


random

public double random()
Generate random numbers between 0.0 and 1.0. This is used to provide portability across different systems.


random

public double random(double id0,
                     double id1)
Generate random number between (min,max).


rGBToHSV

public void rGBToHSV(double[] id0,
                     double[] id1)
Convert color in RGB format (Red, Green, Blue) to HSV format (Hue, Saturation, Value). The input color is not modified.


hSVToRGB

public void hSVToRGB(double[] id0,
                     double[] id1)
Convert color in HSV format (Hue, Saturation, Value) to RGB format (Red, Green, Blue). The input color is not modified.


uninitializeBounds

public void uninitializeBounds(double[] id0)
Are the bounds initialized?


areBoundsInitialized

public int areBoundsInitialized(double[] id0)

VTKInit

public void VTKInit()
Overrides:
VTKInit in class vtkObject

VTKCastInit

protected void VTKCastInit()
Overrides:
VTKCastInit in class vtkObject


Copyright © 2004 Sydney ViSLAB. All Rights Reserved.