[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-talk
Subject:    Re: Is this a floating point precision problem?
From:       Caleb Tennis <caleb () aei-tech ! com>
Date:       2006-01-30 23:04:53
Message-ID: CA805F08-2F46-415D-9159-BA6C87286D41 () aei-tech ! com
[Download RAW message or body]

>
> This matrix...
>     -0.0108226964530337  -0.224934679233174 -0.974313737622412
>       0.0468247818757306    0.973187905351297 -0.225194894880513
>     -0.998844486916645      0.0480592442327619 0.0
>
> will invert to this...
>   64.0                               0.0
> -0.998844486916645
>     0.0                               1.0
> 0.0480592442327619
>   -0.974313737622412 -0.225194894880513 -2.40312135813741e-18
>
>

I don't get the same inverse; maybe that's a good place to look?

irb(main):031:0> a.inv
=> Matrix[[-0.0108184814453125, 0.0468254089355469,  
-0.998844487934061], [-0.224935054779053, 0.973188042640686,  
0.0480592423711387], [-0.974313745084977, -0.22519489645261,  
-1.18537417594384e-11]]


With my inverse above, v*a*ainv looks good:

irb(main):033:0> v*a*ainv
=> Matrix[[0.0155250005999241, -5.8380675554276e-10,  
-6.04039249192278e-21], [4.76057619505643e-08, -0.284744036326806,  
-1.09843285920372e-18], [-2.25029812272581e-06,  
-3.29933630031226e-07, 0.53221899]]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic