1
/////////////////////////////////////////////////////////////
3
// Copyright (c) 2007-2011 by The University of Queensland //
4
// Earth Systems Science Computational Centre (ESSCC) //
5
// http://www.uq.edu.au/esscc //
7
// Primary Business: Brisbane, Queensland, Australia //
8
// Licensed under the Open Software License version 3.0 //
9
// http://www.opensource.org/licenses/osl-3.0.php //
11
/////////////////////////////////////////////////////////////
13
#include "fit_2d_sphere_line.h"
21
fit_2d_sphere_line_fn::fit_2d_sphere_line_fn(const Vector3& sc1, double r1,const Vector3& sc2, double r2,const Vector3& o, const Vector3& n)
33
double fit_2d_sphere_line_fn::operator()(const nvector<double,2>& data) const
37
double ra=sqrt((x-m_p1.x())*(x-m_p1.x())+(y-m_p1.y())*(y-m_p1.y()))-m_r1;
38
double rb=sqrt((x-m_p2.x())*(x-m_p2.x())+(y-m_p2.y())*(y-m_p2.y()))-m_r2;
39
double rc=fabs(dot((Vector3(x,y,0.0)-m_orig),m_nor));
40
double rq=(ra+rb+rc)/3.0;
41
double dr=sqrt((rq-ra)*(rq-ra)+(rq-rb)*(rq-rb)+(rq-rc)*(rq-rc));