Calculate angle

6 messages
Open this post in threaded view
|

Calculate angle

 Hi friends....I want calculate angle from a line.example x1,y1 and x2,y2 so the output is degree of angle that line. I hope there are some one can help me. Thanks before.       Bersenang-senang di Yahoo! Messenger dengan semua teman. Tambahkan mereka dari email atau jaringan sosial Anda sekarang! http://id.messenger.yahoo.com/invite/[Non-text portions of this message have been removed]
Open this post in threaded view
|

RE: Calculate angle

 (y1-y2)/(x1-x2) = tan alpha    (assuming the denominator isn't zero).   then alpha * 180/pi converts from radians to degrees   _____   From: [hidden email] [mailto:[hidden email]] On Behalf Of mas aji Sent: Wednesday, January 07, 2009 12:32 AM To: [hidden email] Subject: [OpenCV] Calculate angle Hi friends....I want calculate angle from a line.example x1,y1 and x2,y2 so the output is degree of angle that line. I hope there are some one can help me. Thanks before. Bersenang-senang di Yahoo! Messenger dengan semua teman. Tambahkan mereka dari email atau jaringan sosial Anda sekarang! http://id.messenger .yahoo.com/invite/ [Non-text portions of this message have been removed]   [Non-text portions of this message have been removed]
Open this post in threaded view
|

Re: Calculate angle

 In reply to this post by mas aji like this: float GetSlope(CvPoint2D32f pt1, CvPoint2D32f pt2) {         float fSlope, fYInt, fAngle = 90, fRun = pt2.x - pt1.x;         bool bInfSlope = (fRun == 0);         if (!bInfSlope)         {                 fSlope = (pt2.y - pt1.y)/fRun;                 fAngle = (float)(180.0 * atan((double)fSlope)/PI);                 fYInt = -fSlope * pt1.x + pt1.y;         }         return fAngle; } Ed --- In [hidden email], mas aji wrote: > > Hi friends....I want calculate angle from a line.example x1,y1 and x2,y2 > so the output is degree of angle that line. > I hope there are some one can help me. > > Thanks before. > > > >       Bersenang-senang di Yahoo! Messenger dengan semua teman. Tambahkan mereka dari email atau jaringan sosial Anda sekarang! http://id.messenger.yahoo.com/invite/> > [Non-text portions of this message have been removed] >
Open this post in threaded view
|

Re: Calculate angle

 In reply to this post by mas aji cvFastArctan(y2-y1,x2-x1)? On Wed, Jan 7, 2009 at 5:31 AM, mas aji <[hidden email]> wrote: >   Hi friends....I want calculate angle from a line.example x1,y1 and x2,y2 > so the output is degree of angle that line. > I hope there are some one can help me. > > Thanks before. > > Bersenang-senang di Yahoo! Messenger dengan semua teman. Tambahkan mereka > dari email atau jaringan sosial Anda sekarang! > http://id.messenger.yahoo.com/invite/> > [Non-text portions of this message have been removed] > >   > [Non-text portions of this message have been removed]