Home > Community > Forums > PCB SKILL > Find the angle between two segments

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 Find the angle between two segments 

Last post Mon, May 6 2013 7:33 PM by eDaNoy. 5 replies.
Started by eDaNoy 06 May 2013 06:38 PM. Topic has 5 replies and 1035 views
Page 1 of 1 (6 items)
Sort Posts:
  • Mon, May 6 2013 6:38 PM

    • eDaNoy
    • Top 200 Contributor
    • Joined on Fri, Sep 9 2011
    • SBMA, Philippines
    • Posts 41
    • Points 940
    Find the angle between two segments Reply

    angle

    I would like to get the angle between two segments, this must be applied to any angled situation.

    I have already a function that gets the slope of two segments then the rest is a problem, i cant get the correct result

    im using this formula.

    angle=(m2-m1)/[1+(m2*m1)]

    atan(angle)*180/math.pi

    the result must be the added angle of two segments.

     

    sample 1st segment = 90 degree

    second segment = 45 degree

     result = 135 degree 

    Filed under: ,
    • Post Points: 20
  • Mon, May 6 2013 6:56 PM

    • eDave
    • Top 10 Contributor
    • Joined on Sun, Jul 13 2008
    • Christchurch, 00-NZ
    • Posts 738
    • Points 16,055
    Re: Find the angle between two segments Reply

    There are some complex ways to do this but there is an undocumented command that you might be able to use:

    _axlAngleBetweenLines(list(pt1, pt2), list(pt3, pt4)) 

    Dave Elder, Tait Communications
    • Post Points: 35
  • Mon, May 6 2013 7:18 PM

    • eDaNoy
    • Top 200 Contributor
    • Joined on Fri, Sep 9 2011
    • SBMA, Philippines
    • Posts 41
    • Points 940
    Re: Find the angle between two segments Reply
    thanks Dave, i added some method to get the value that i want. _axlAngleBetweenLines result was in radian 180-_axlAngleBetweenLines()*180/math.pi gives me accumulated angles thank you so much. one more thing where could i find undocumented axl? maybe or somehow Im already in this kind of situation trying to figure out something which is already done.
    • Post Points: 20
  • Mon, May 6 2013 7:25 PM

    • eDaNoy
    • Top 200 Contributor
    • Joined on Fri, Sep 9 2011
    • SBMA, Philippines
    • Posts 41
    • Points 940
    Re: Find the angle between two segments Reply

    Dave,

     Is it safe to use undocumented axl? 

    • Post Points: 5
  • Mon, May 6 2013 7:26 PM

    • eDave
    • Top 10 Contributor
    • Joined on Sun, Jul 13 2008
    • Christchurch, 00-NZ
    • Posts 738
    • Points 16,055
    Re: Find the angle between two segments Reply

    There's no easy way of finding undocumented commands and there is no guarantee that they will always exist. USE WITH CARE.

    However, when you do find one that is useful, put in an enhancement request to Cadence to get it made public. 

    Dave Elder, Tait Communications
    • Post Points: 20
  • Mon, May 6 2013 7:33 PM

    • eDaNoy
    • Top 200 Contributor
    • Joined on Fri, Sep 9 2011
    • SBMA, Philippines
    • Posts 41
    • Points 940
    Re: Find the angle between two segments Reply
    thanks dave
    • Post Points: 5
Page 1 of 1 (6 items)
Sort Posts:
Started by eDaNoy at 06 May 2013 06:38 PM. Topic has 5 replies.