GETERRORVEC returns the error for each point. GETERRORVEC contains the main error calculation function. The function is called by other function to analyse the error. USAGE: INPUTS: Lpts: 3xN vector containing all the laser board points. Nc: 3xN vector containing the corresponding normal vector. delta: 3x1 translation vector output by the calibration. phi: 3x3 rotation matrix output by the calibration. OUTPUTS: errorvec: 1xN vector representing the errors for each point.
0001 function errorvec=geterrorvec(Lpts,Nc,delta,phi) 0002 % GETERRORVEC returns the error for each point. 0003 % 0004 % GETERRORVEC contains the main error calculation function. The function is 0005 % called by other function to analyse the error. 0006 % 0007 % USAGE: 0008 % 0009 % INPUTS: 0010 % Lpts: 3xN vector containing all the laser board points. 0011 % 0012 % Nc: 3xN vector containing the corresponding normal vector. 0013 % 0014 % delta: 3x1 translation vector output by the calibration. 0015 % 0016 % phi: 3x3 rotation matrix output by the calibration. 0017 % 0018 % OUTPUTS: 0019 % errorvec: 1xN vector representing the errors for each point. 0020 0021 0022 delta=delta(:); % make sure delta is a column vector 0023 npts=size(Lpts,2); 0024 0025 % main error equation 0026 errorvec=dot(Nc,inv(phi)*Lpts+repmat(delta,[1,npts]))./sqrt(sum(Nc.^2))-sqrt(sum(Nc.^2));