55 const double a0,
const double a1,
const double theta)
56 : myCenter(x0,y0), myAxis1(a0),myAxis2(a1),myTheta(theta)
63 const double a0,
const double a1,
const double theta)
64 : myCenter(aPoint), myAxis1(a0),myAxis2(a1),myTheta(theta)
70 const double a0,
const double a1,
const double theta)
71 : myAxis1(a0),myAxis2(a1),myTheta(theta)
102 else if ( ( v2d[0] > 0.0 ) && ( v2d[1] >= 0.0 ) )
103 angle = atan(v2d[1]/v2d[0]);
104 else if ( ( v2d[0] > 0.0 ) && ( v2d[1] <= 0.0 ) )
105 angle = 2*
M_PI + atan(v2d[1]/v2d[0]);
106 else if ( ( v2d[0] < 0.0 ) && ( v2d[1] >= 0.0 ) )
107 angle = atan(v2d[1]/v2d[0]) +
M_PI;
109 angle = atan(v2d[1]/v2d[0]) +
M_PI;
120 template <
typename T>
125 double a2 = myAxis1*myAxis1;
126 double b2 = myAxis2*myAxis2;
127 double costth = cos( t - myTheta );
129 double cost = cos( t );
130 double sint = sin( t );
131 double rho = myAxis2 / sqrt( 1.0 - ((a2-b2)/a2)*costth*costth);
146 template <
typename T>
151 double a2 = myAxis1*myAxis1;
152 double b2 = myAxis2*myAxis2;
153 double costth = cos( t - myTheta );
154 double sintth = sin( t - myTheta );
155 double cost = cos( t );
156 double sint = sin( t );
157 double rho = myAxis2 / sqrt( 1.0 - ((a2-b2)/a2)*costth*costth);
160 double rhod= a*b*(b2-a2)*sintth*costth
161 / std::pow( a2*sintth*sintth + b2*costth*costth, 1.5 );
162 RealPoint2D v( rhod*cost - rho*sint, rhod*sint + rho*cost );
172 template <
typename T>
177 double a2 = myAxis1*myAxis1;
178 double b2 = myAxis2*myAxis2;
179 double costth = cos( t - myTheta );
180 double sintth = sin( t - myTheta );
181 double cost = cos( t );
182 double sint = sin( t );
183 double rho = myAxis2 / sqrt( 1.0 - ((a2-b2)/a2)*costth*costth);
187 double rhod = a*b*(b2-a2)*sintth*costth
188 / std::pow( a2*sintth*sintth + b2*costth*costth, 1.5 );
189 double rhodd = a*b*(b2-a2)
190 / std::pow( a2*sintth*sintth + b2*costth*costth, 2.5 )
191 * ( (costth*costth - sintth*sintth) * (a2*sintth*sintth + b2*costth*costth)
192 + 3.0*(b2-a2)*sintth*sintth*costth*costth );
194 RealPoint2D v( rhodd*cost - 2.0*rhod*sint - rho*cost,
195 rhodd*sint + 2.0*rhod*cost - rho*sint );
207 template <
typename T>
212 out <<
"[Ellipse2D] center= "<<myCenter<<
" big axis="<<myAxis1
213 <<
" small axis="<<myAxis2<<
" phase="<<myTheta;
220 template <
typename T>
233 template <
typename T>
239 object.selfDisplay( out );