29 for (
int i = 0; i < ifn.
size(); i++)
30 a_.push_back(ifn.
a()[i]);
40 int n_pt_profile = this->
size();
44 for (
int i = 0; i < n_pt_profile; i++)
79 a_point z_dir =
path.dz_axis(
a);
83 std::vector<a_point> points_n;
84 for (
int i = 0; i < n_pt_profile; i++)
89 a_point pyz_r = (pyz.norm())*
y_axis;
90 a_point xn =
centre+pyz_r+px;
91 points_n.push_back(xn);
93 for (
int i = 0; i < n_pt_profile; i++)
108 a_point * p0 =
x_[0];
109 for (
int i = 1; i <
n_pts_; i++)
112 l += (*p-*p0).norm();
117 for (
int i = 1; i <
n_pts_; i++)
138 return **(
x_.end()-1);
140 a_point x1 = *
x_[
ref];
143 double a2 =
a_[
ref+1];
144 double f = (
a-a1)/(a2-a1);
145 return (x1 + (
x2-x1)*f);
160 if ((z-
horiz_).norm()<1e-5)
162 else if ((z+
horiz_).norm()<1e-5)
176 a_point x1 = *
x_[
n-2];
177 a_point
x2 = *
x_[
n-1];
178 return (
x2-x1).normalise();
183 double a2 =
a_[
ref+1];
184 double f = (
a-a1)/(a2-a1);
187 return (x1 + (
x2-x1)*f).normalise();
197 double a2 =
a_[
ref+1];
198 double f = (
a-a1)/(a2-a1);
201 return x1 + (
x2-x1)*f;
211 p2 = *
x_[int((
n-1)/3.+.5)];
212 p3 = *
x_[int((
n-1)/1.5+.5)];
217 p2 = *
x_[int((
n-1)/2.+.5)];
220 return circle_centre(p1,p2,p3);
234 p1 = (*this)(
a-0.01);
236 p3 = (*this)(
a+0.01);
244 return circle_centre(p1,p2,p3);
258 if (f1>0)
return *
this;
259 if (f2<1)
return *
this;
265 double rn1 = r1.norm();
266 double rn2 = r2.norm();
271 double da = acos(r1*r2)/(2.*
n_pts_);
275 double ds = 2*rn1*sin(
da);
277 for (
int i=0; i <
n; i++)
279 a_point uy = (
centre-
x).normalise();
281 x -= ds*(ux*cos(
da)+uy*sin(
da));
282 auto xp =
new a_point(
x);
289 double ds = 2*rn2*sin(
da);
291 for (
int i=0; i <
n; i++)
293 a_point uy = (
centre-
x).normalise();
295 x += ds*(ux*cos(
da)+uy*sin(
da));
296 auto xp =
new a_point(
x);
316 std::vector<double> merge;
317 int n1 = pat1.
size();
318 int n2 = pat2.
size();
322 for (
int i = 0; i < n1; i++)
324 a_point p1 = *pat1[i];
325 a_point p2 = *pat2[i];
326 auto p =
new a_point(p1+a*(p2-p1));
327 patn.
x_.push_back(p);
std::istream & operator>>(std::istream &in, a_curve_lin &f)
a_curve_lin interpolate(const a_curve_lin &pat1, const a_curve_lin &pat2, double a)
a curve with linear interpolation
a_point dx_axis(double a) const
a_point dz_axis(double a) const
a_curve_lin(double da=1e-6)
a_curve_lin & extrapolate(double f1, double f2)
a_point curvature_centre() const
double curvature(double a) const
a_point operator()(double a) const
a_point tangent(double a) const
std::vector< double > & a()
a_point dy_axis(double a) const
sampled parametric function class (interface)
std::deque< a_point * > & x()
virtual a_point dz_axis(double a) const
double dist(const a_point &, int &ref) const
bool is_closed() const
!!!!!!
std::deque< a_point * > x_
e_point cross(e_point &a, e_point &b)
a_point normal(int i, int l)
std::vector< a_point * > path