Code covered by the BSD License  

Highlights from
Geodetic Toolbox

Geodetic Toolbox


Mike Craymer (view profile)


13 Jun 2007 (Updated )

Toolbox for angle, coordinate and date conversions and transformations. Version 2.97.

function [ax,az,inc]=errell3(C)
% ERRELL3  Computes 3D error ellipsoid from covariance matrix.
%   Semi-axes lengths, azimuth, inclinations are ordered
%   from smallest to largest.  Note: x & y represent north
%   & south (opposite of normal MatLab convention).
%   Non-vectorized for multiple stations.  See also ERRELL2.
% Version: 18 Jan 96
% Useage:  [ax,az,inc]=errell3(C)
% Input:   C  - covariance matrix (3D)
% Output:  a  - vector of semi-axes lengths
%          az - vector of semi-axes azimuths (rad)
%          inc- vector of semi-axes inclinations (rad)

% Copyright (c) 2011, Michael R. Craymer
% All rights reserved.
% Email:

if nargin~=1
  error('Wrong number of input arguments');
if (nargout~=3)
  error('Wrong number of output arguments');
[V,D]=eig(C);            % Eigenvalues & vectors
[d,ind]=sort(diag(D));   % Sort eigenvalues
V=V(:,ind);              % and eigenvectors
%d=flipud(d);     % flip order to (max to min)

Contact us