55 const double radius,
const double smallRadius,
56 const unsigned int k,
const double phi)
57 : myCenter(x0,y0), myRadius(radius), myVarRadius(smallRadius),
67 const double smallRadius,
68 const unsigned int k,
const double phi)
69 : myCenter(aPoint), myRadius(radius), myVarRadius(smallRadius),
78 const double smallRadius,
79 const unsigned int k,
const double phi)
80 : myRadius(radius), myVarRadius(smallRadius), myK(k), myPhi(phi)
104 if ( ( p.at( 0 ) == 0.0 ) && ( p.at( 1 ) == 0.0 ) )
107 if ( p.at( 0 ) >= p.at( 1 ) )
109 if ( p.at( 0 ) >= -p.at( 1 ) )
110 angle = atan( p.at( 1 ) / p.at( 0 ) );
112 angle = 1.5*
M_PI + atan( - p.at( 0 ) / p.at( 1 ) );
116 if ( p.at( 0 ) >= -p.at( 1 ) )
117 angle = 0.5*
M_PI - atan( p.at( 0 ) / p.at( 1 ) );
119 angle =
M_PI + atan( p.at( 1 ) / p.at( 0 ) );
121 angle = ( angle < 0.0 ) ? angle + 2*
M_PI : angle;
131 template <
typename T>
137 while ( tt >=
M_PI ) tt -= 2 *
M_PI;
138 while ( tt < -
M_PI ) tt += 2 *
M_PI;
140 double ktn = myKp * tt * tt * tt;
141 double r = myRadius + myVarRadius * cos( ktn );
154 template <
typename T>
163 double ktn = myKp * t * t * t;
164 double ktnp = 3 * myKp * t * t ;
166 double r = myRadius + myVarRadius * cos( ktn );
167 double rp = - myVarRadius * sin( ktn ) * ktnp;
169 rp * sin( t ) + r * cos( t ) );
178 template <
typename T>
187 double ktn = myKp * t * t * t;
188 double ktnp = 3 * myKp * t * t;
189 double ktnpp = 6 * myKp * t;
191 double r = myRadius + myVarRadius * cos( ktn );
192 double rp = - myVarRadius * sin( ktn ) * ktnp;
193 double rpp = - myVarRadius * cos( ktn ) * ktnp * ktnp -
194 myVarRadius * sin( ktn ) * ktnpp;
196 RealPoint2D c( rpp * cos( t ) - 2 * rp * sin( t ) - r * cos( t ),
197 rpp * sin( t ) + 2 * rp * cos( t ) - r * sin( t ) );
209 template <
typename T>
214 out <<
"[AccFlower2D] center= "<<myCenter<<
" radius="<<myRadius<<
" smallradius="<<myVarRadius
215 <<
" myK="<<myK<<
" phase-shift="<<myPhi;
222 template <
typename T>
235 template <
typename T>
241 object.selfDisplay( out );