Calculate angle

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Calculate angle

mas aji
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]

Reply | Threaded
Open this post in threaded view
|

RE: Calculate angle

Dave Grossman
(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
<http://id.messenger.yahoo.com/invite/> .yahoo.com/invite/

[Non-text portions of this message have been removed]



 


[Non-text portions of this message have been removed]

Reply | Threaded
Open this post in threaded view
|

Re: Calculate angle

Ed Elston
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 <maswit_to@...> 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]
>


Reply | Threaded
Open this post in threaded view
|

Re: Calculate angle

Carlos Frederico Mendes
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]

Reply | Threaded
Open this post in threaded view
|

Re: Calculate angle

Phani Bhushan Tholeti
> 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

A test to the intelligence of the ppl here?
STFW/G

On Wed, Jan 7, 2009 at 20:04, Carlos Frederico Mendes
<[hidden email]>wrote:

>   cvFastArctan(y2-y1,x2-x1)?
>
>
> On Wed, Jan 7, 2009 at 5:31 AM, mas aji <[hidden email]<maswit_to%40yahoo.co.id>>
> 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]
>
>  
>



--
Lots o' Luv,
Phani Bhushan

Let not your sense of morals prevent you from doing what is right - Isaac
Asimov (Salvor Hardin in Foundation and Empire)


[Non-text portions of this message have been removed]

Reply | Threaded
Open this post in threaded view
|

Bls: Calculate angle

mas aji
In reply to this post by Carlos Frederico Mendes
Thank you so much...that's Fine...Good.




________________________________
Dari: Carlos Frederico Mendes <[hidden email]>
Kepada: [hidden email]
Terkirim: Rabu, 7 Januari, 2009 21:34:02
Topik: Re: [OpenCV] Calculate angle


cvFastArctan( y2-y1,x2- x1)?

On Wed, Jan 7, 2009 at 5:31 AM, mas aji <maswit_to@yahoo. co.id> 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]

   


      ___________________________________________________________________________
Nama baru untuk Anda!
Dapatkan nama yang selalu Anda inginkan di domain baru @ymail dan @rocketmail.
Cepat sebelum diambil orang lain!
http://mail.promotions.yahoo.com/newdomains/id/

[Non-text portions of this message have been removed]