| 316 | | Gamma[0][0]=1/(a*a);Gamma[0][1]=Gamma[0][2]=0; |
| 317 | | Gamma[1][1]=1/(b*b);Gamma[1][0]=Gamma[1][2]=0; |
| 318 | | Gamma[2][2]=1/(c*c);Gamma[2][0]=Gamma[2][1]=0; |
| 319 | | |
| 320 | | rot_transpose(Q,Q_t); |
| 321 | | rot_mul(Gamma,Q_t,Tmp); |
| 322 | | rot_mul(Q,Tmp,A); |
| | 316 | Gamma[0][0]=Gamma[0][1]=Gamma[0][2]=0; |
| | 317 | Gamma[1][1]=Gamma[1][0]=Gamma[1][2]=0; |
| | 318 | Gamma[2][2]=Gamma[2][0]=Gamma[2][1]=0; |
| | 319 | /*now set diagonal to ellipsoid half axis if non-zero. |
| | 320 | * This way a zero value mean the sllipsoid extends infinitely along that axis, |
| | 321 | * which is useful for objects only curved in one direction*/ |
| | 322 | if (a!=0){ |
| | 323 | Gamma[0][0]=1/(a*a); |
| | 324 | } |
| | 325 | if (b!=0){ |
| | 326 | Gamma[1][1]=1/(b*b); |
| | 327 | } |
| | 328 | if (c!=0){ |
| | 329 | Gamma[2][2]=1/(c*c); |
| | 330 | } |
| | 331 | |
| | 332 | if (Q!=NULL){ |
| | 333 | rot_transpose(Q,Q_t); |
| | 334 | rot_mul(Gamma,Q_t,Tmp); |
| | 335 | rot_mul(Q,Tmp,A); |
| | 336 | }else{ |
| | 337 | rot_copy(A,Gamma); |
| | 338 | } |