changeset 11272:ae492dac68d4 octave-forge

geometry: applying rafael's patch.
author jpicarbajal
date Tue, 27 Nov 2012 11:51:38 +0000
parents f063039302a6
children 93c93f229d25
files main/geometry/inst/geom2d/cov2ellipse.m
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/main/geometry/inst/geom2d/cov2ellipse.m	Mon Nov 26 21:31:44 2012 +0000
+++ b/main/geometry/inst/geom2d/cov2ellipse.m	Tue Nov 27 11:51:38 2012 +0000
@@ -2,16 +2,16 @@
 ## Copyright (C) 2004-2011 INRA - CEPIA Nantes - MIAJ (Jouy-en-Josas)
 ## Copyright (C) 2012 Adapted to Octave by Juan Pablo Carbajal <carbajal@ifi.uzh.ch>
 ## All rights reserved.
-## 
+##
 ## Redistribution and use in source and binary forms, with or without
 ## modification, are permitted provided that the following conditions are met:
-## 
+##
 ##     1 Redistributions of source code must retain the above copyright notice,
 ##       this list of conditions and the following disclaimer.
 ##     2 Redistributions in binary form must reproduce the above copyright
 ##       notice, this list of conditions and the following disclaimer in the
 ##       documentation and/or other materials provided with the distribution.
-## 
+##
 ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ''AS IS''
 ## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 ## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -53,8 +53,8 @@
     print_usage
   end
   [R S W] = svd (K);
-  theta = atan (R(1,1)/R(2,2));
-  v     = sort (diag(S), 'ascend')';
+  theta = atan2 (R(2,1), R(1,1));
+  v     = sqrt (diag(S))';
 
   if nargout == 1
     varargout{1} = [0 0 v theta*180/pi];