Home > FR3DSource > xPrecomputeForDiscrepancy.m

xPrecomputeForDiscrepancy

PURPOSE ^

xPrecomputeForDiscrepancy(c) computes a few things that are needed for

SYNOPSIS ^

function [c] = xPrecomputeForDiscrepancy(c)

DESCRIPTION ^

 xPrecomputeForDiscrepancy(c) computes a few things that are needed for
 the full discrepancy calculation.  c is a structured variable with fields
 NT, LocWeight, NumNT

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % xPrecomputeForDiscrepancy(c) computes a few things that are needed for
0002 % the full discrepancy calculation.  c is a structured variable with fields
0003 % NT, LocWeight, NumNT
0004 
0005 function [c] = xPrecomputeForDiscrepancy(c)
0006 
0007 c.Centers = cat(1,c.NT.Center);
0008 
0009 if c.NumNT > 2,
0010   c.WeightedCenter          = c.LocWeight * c.Centers / c.NumNT;
0011   c.CenteredCenters         = c.Centers-ones(c.NumNT,1)*c.WeightedCenter;
0012   c.WeightedCenteredCenters = diag(c.LocWeight)* c.CenteredCenters;
0013 elseif c.NumNT == 2,
0014   c.R  = c.NT(2).Rot' * c.NT(1).Rot;
0015   c.T1 = (c.NT(2).Center - c.NT(1).Center)*c.NT(1).Rot;
0016   c.T2 = (c.NT(1).Center - c.NT(2).Center)*c.NT(2).Rot;
0017 end

Generated on Fri 03-Apr-2009 09:52:35 by m2html © 2003