[vtkusers] vtkmath

Gerald Dalley dalleyg at dma.org
Mon Dec 18 13:05:04 EST 2000


Another hint:  you don't actually have to make an instance of vtkMath to use
it for most (all?) of the methods because they are static methods.  So you
can generally just do things like answer = vtkMath::InvertMatrix(pt, pt2, 3)
after making sure that pt is invertible.
  -----Original Message-----
  From: vtkusers-admin at public.kitware.com
[mailto:vtkusers-admin at public.kitware.com]On Behalf Of Harris Scott R CIV
AFRL/SNJM
  Sent: Monday, 18 December 2000 12:01 PM
  To: 'kalkie'; vtkusers at public.kitware.com
  Subject: RE: [vtkusers] vtkmath


  I'm not familiar with vtkMath, but both of the matrices in your code have
a zero determinant; They don't have an inverse.
  -Scott Harris
    -----Original Message-----
    From: kalkie [mailto:jkalkman at HOTMAIL.COM]
    Sent: Monday, December 18, 2000 9:19 AM
    To: vtkusers at public.kitware.com
    Subject: [vtkusers] vtkmath


    Dear VTK-users,

    i'm quite new to vtk. Can anybody help me with the vtkMath method? I
want to invert a matrix. In the code as shown below the variable 'answer'
has the value zero, so the inverse is not calculated. Probably the M-Time
has to be updated, but I don't know how to do that on an object of the
vtkMath class.

    Thanks in advance,
    Jeroen Kalkman

    double **pt, **pt2;
    vtkMath* M = vtkMath::New();

    void main()
    {
     pt = new double* [3], pt2 = new double* [3];
     for(int q=0; q<3; q++) pt[q] = new double [3], pt2[q] = new double [3];
     pt[0][0]=pt[0][1] = pt[0][2] = 1;
     pt[1][0]=pt[1][1] = pt[1][2] = 2;
     pt[2][0]=pt[2][1] = pt[2][2] = 3;
     pt2[0][0]=pt2[0][1] = pt2[0][2] = 0;
     pt2[1][0]=pt2[1][1] = pt2[1][2] = 0;
     pt2[2][0]=pt2[2][1] = pt2[2][2] = 0;
     answer = M->InvertMatrix(pt,pt2,3);
    }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20001218/f6b8b43a/attachment.htm>


More information about the vtkusers mailing list