Degree Values after conversion [closed]

asked 2017-09-05 19:19:43 -0500

zms gravatar image

Hi All, I have few sets of pair coordinates. For each pair, i would like to get the value of the degree and here is my code

double deg = atan((b.y-a.y)/(b.x-a.x)) * 180 / PI;
  std::cout << "deg" <<deg<< std::endl;
  file<<deg<<",";

From the value, it can be resulted for 40 degree. As we know, there is another degree which similar to 40 degree which is 180+40 = 220 degree.

So far, by using the formula, i had never encountered a degree more than 180. Is it possible to have that value i.e 220 degree after arctan process?

edit retag flag offensive reopen merge delete

Closed for the following reason question is off-topic or not relevant by LBerger
close date 2017-09-05 19:37:45.548917

Comments

use atan2. Where is opencv problem?

LBerger gravatar imageLBerger ( 2017-09-05 19:37:28 -0500 )edit

owh sorry, I'm using this in my opencv c++. I thought this would be the right forum to discuss.

Anyway thanks!! alot

zms gravatar imagezms ( 2017-09-05 20:14:43 -0500 )edit