Rev | Line | |
---|
[810] | 1 | %=======================================================================
|
---|
[908] | 2 | % Copyright 2008-2015, LEGI UMR 5519 / CNRS UJF G-INP, Grenoble, France
|
---|
[810] | 3 | % http://www.legi.grenoble-inp.fr
|
---|
| 4 | % Joel.Sommeria - Joel.Sommeria (A) legi.cnrs.fr
|
---|
| 5 | %
|
---|
| 6 | % This file is part of the toolbox UVMAT.
|
---|
| 7 | %
|
---|
| 8 | % UVMAT is free software; you can redistribute it and/or modify
|
---|
| 9 | % it under the terms of the GNU General Public License as published
|
---|
| 10 | % by the Free Software Foundation; either version 2 of the license,
|
---|
| 11 | % or (at your option) any later version.
|
---|
| 12 | %
|
---|
| 13 | % UVMAT is distributed in the hope that it will be useful,
|
---|
| 14 | % but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 15 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 16 | % GNU General Public License (see LICENSE.txt) for more details.
|
---|
| 17 | %=======================================================================
|
---|
| 18 |
|
---|
[725] | 19 | function test = is3D(X),
|
---|
| 20 |
|
---|
| 21 |
|
---|
| 22 | Np = size(X,2);
|
---|
| 23 |
|
---|
| 24 | %% Check for planarity of the structure:
|
---|
| 25 |
|
---|
| 26 | X_mean = mean(X')';
|
---|
| 27 |
|
---|
| 28 | Y = X - (X_mean*ones(1,Np));
|
---|
| 29 |
|
---|
| 30 | YY = Y*Y';
|
---|
| 31 |
|
---|
| 32 | [U,S,V] = svd(YY);
|
---|
| 33 |
|
---|
| 34 | r = S(3,3)/S(2,2);
|
---|
| 35 |
|
---|
| 36 | test = (r > 1e-3);
|
---|
| 37 |
|
---|
Note: See
TracBrowser
for help on using the repository browser.