@@ -220,50 +220,6 @@ void rotArcballTrans(Matrix4fT &matfT, const Vector3d &axis, double angle)
220220 }
221221}
222222
223- // // from V1 to V2
224- // template< size_t M, typename T >
225- // long double angleBetween(const vmml::vector< M, T > V1, const vmml::vector< M, T > V2 )
226- // {
227- // long double dotproduct = V1.dot(V2);
228- // long double length = V1.length() * V2.length();
229- // long double quot = dotproduct / length;
230- // if (quot > 1 && quot < 1.0001) quot = 1; // strange case where acos => NaN
231- // if (quot < -1 && quot > -1.0001) quot = -1;
232- // long double result = acosl( quot ); // 0 .. pi
233- // if (isleftof(T(), V2, V1))
234- // result = -result;
235- // return result;
236- // }
237-
238- // from V1 to V2
239- long double angleBetween (const Vector3d &V1, const Vector3d &V2)
240- {
241- long double dotproduct = V1.dot (V2);
242- long double length = sqrt (V1.squared_length () * V2.squared_length ());
243- if (length==0 ) return 0 ;
244- long double quot = dotproduct / length;
245- if (quot > 1 && quot < 1.0001 ) quot = 1 ; // strange case where acos => NaN
246- if (quot < -1 && quot > -1.0001 ) quot = -1 ;
247- long double result = acosl ( quot ); // 0 .. pi
248- if (isleftof (Vector3d (0 ,0 ,0 ), V2, V1))
249- result = -result;
250- return result;
251- }
252-
253- long double angleBetween (const Vector2d &V1, const Vector2d &V2)
254- {
255- long double dotproduct = V1.dot (V2);
256- long double length = sqrt (V1.squared_length () * V2.squared_length ());
257- if (length==0 ) return 0 ;
258- long double quot = dotproduct / length;
259- if (quot > 1 && quot < 1.0001 ) quot = 1 ;
260- if (quot < -1 && quot > -1.0001 ) quot = -1 ;
261- long double result = acosl ( quot ); // 0 .. pi
262- if (isleftof (Vector2d (0 ,0 ), V2, V1))
263- result = -result;
264- return result;
265- }
266-
267223// return A halfway rotated around center in direction of B
268224Vector2d angle_bipartition (const Vector2d ¢er, const Vector2d &A, const Vector2d &B)
269225{
@@ -272,7 +228,6 @@ Vector2d angle_bipartition(const Vector2d ¢er, const Vector2d &A, const Vect
272228}
273229
274230
275-
276231// is B left of A wrt center?
277232bool isleftof (const Vector2d ¢er, const Vector2d &A, const Vector2d &B)
278233{
0 commit comments