Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Point Rotation problem or Bug ?

Subject: CGAL users discussion list

List archive

[cgal-discuss] Point Rotation problem or Bug ?


Chronological Thread 
  • From: "naresh" <>
  • To: <>
  • Subject: [cgal-discuss] Point Rotation problem or Bug ?
  • Date: Thu, 12 Mar 2009 12:53:06 +0530

Hi
 
I am trying rotate 2d point but i am getting unexpected result from input. here is code.

typedef CGAL::Quotient<float> NT;

typedef CGAL::Cartesian<NT> CartesianFloat;

typedef CartesianFloat::Point_2 Point;

typedef CartesianFloat::Aff_transformation_2 Transformation;

int main()

{

    Transformation rotate(ROTATION, sin(fAngle), cos(fAngle));

Point p0; <= i have some points to rotate from array

std::cout << "Point X : " << CGAL::to_double(p0.x())

<< " Y : " << CGAL::to_double(p0.y()) << std::endl;

p0 = rotate(p0);

std::cout << "Point X : " << CGAL::to_double(p0.x())

<< " Y : " << CGAL::to_double(p0.y()) << std::endl;

   return 0;

}

And Here is result from input

Original X : 159.91 Y : 1005.52

Original X : -166.478 Y : 995.262

Rotated X : -1.#IND Y : -1.#IND

Rotated X : -197.657 Y : 989.541

Original X : 159.91 Y : -995.468

Original X : -166.478 Y : -1005.7

Rotated X : -1.#IND Y : -1.#IND

Rotated X : -134.805 Y : -1010.46

Original X : 159.91 Y : -995.468

Original X : 159.91 Y : 1005.52

Rotated X : -1.#IND Y : -1.#IND

Rotated X : -1.#IND Y : -1.#IND

So  i am getting -1.#IND  when value is 159.91 as input.  These problem i am getting in my code. I had posted little rotation code from my functions.

So I this bug or i am doing anything wrong ?

 

 

 




Archive powered by MHonArc 2.6.16.

Top of Page