Home > polypedal > tarTr > ellipseDist.m

ellipseDist

PURPOSE ^

ellipseDist [D] = ellipseDist( sz, elps )

SYNOPSIS ^

function D = ellipseDist( sz, elps )

DESCRIPTION ^

ellipseDist [D] = ellipseDist( sz, elps )

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function D = ellipseDist( sz, elps )
0002 %ellipseDist [D] = ellipseDist( sz, elps )
0003   
0004   elc = mean(elps([1 3; 2 4]));         % Ellipse center
0005   [X,Y] = meshgrid( linspace(-sz(2)/2,sz(2)/2,sz(2)),...
0006                     linspace(-sz(1)/2,sz(1)/2,sz(1)) );
0007   WH = diff( elps( [1 3; 2 4] ));                
0008   D = sqrt( X.^2./WH(1).^2+Y.^2./WH(2).^2 )*sqrt(WH(1)*WH(2));

Generated on Mon 02-Aug-2010 16:44:38 by m2html © 2003