Home > Community > Forums > PCB SKILL > Check Parallel lines if intersect

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: *

 Check Parallel lines if intersect 

Last post Sun, May 26 2013 11:09 PM by D912349. 7 replies.
Started by eDaNoy 21 May 2013 08:28 AM. Topic has 7 replies and 1360 views
Page 1 of 1 (8 items)
Sort Posts:
  • Tue, May 21 2013 8:28 AM

    • eDaNoy
    • Top 200 Contributor
    • Joined on Sat, Sep 10 2011
    • SBMA, Philippines
    • Posts 41
    • Points 940
    Check Parallel lines if intersect Reply

     

    Image and video hosting by TinyPic

    given image above,

    I would like to check both segments (maroon/orange line could be in any slope value) which are parallel to each other if they intersect.

    dashed lines are the perpendicular lines of the maroon or of the orange line (my plan is to use these to get the intersections) .

    The problem now is, how can i get the points of the perpendicular lines.

    Im welcome for other suggestions.

    • Post Points: 20
  • Tue, May 21 2013 9:45 AM

    • aCraig
    • Top 50 Contributor
    • Joined on Sat, Aug 16 2008
    • Pepperell, MA
    • Posts 132
    • Points 2,070
    Re: Check Parallel lines if intersect Reply

    On Cadence support search for clinecut. It should return a link to clinecut.il it should a good example to finding intersections. Also you can try axl_ol_ol2.

     Craig

    • Post Points: 20
  • Tue, May 21 2013 5:15 PM

    • eDaNoy
    • Top 200 Contributor
    • Joined on Sat, Sep 10 2011
    • SBMA, Philippines
    • Posts 41
    • Points 940
    Re: Check Parallel lines if intersect Reply

    Thanks Craig for the suggestion.

    I to look for the clinecut.il but its not what i want.

    Yes, Im already using axl_ol_ol2 to get the intersections.

    My problem was,

    how can i create a perpendicular(dashed line, see above image) by using either orange or maroon lines to detect if both parrallel lines face each other.Even with only one intersection result can prove that both parallel lines are facing each other.  

    • Post Points: 20
  • Wed, May 22 2013 8:00 AM

    • aCraig
    • Top 50 Contributor
    • Joined on Sat, Aug 16 2008
    • Pepperell, MA
    • Posts 132
    • Points 2,070
    Re: Check Parallel lines if intersect Reply

    To get the perpendicular line you will need to do some vector math. First get the unit vector of the marroon/yellow line (pt1 pt2). From the unit vector you can get he perpendicular vector (-pt2 pt1).

     Craig

    • Post Points: 20
  • Wed, May 22 2013 7:14 PM

    • eDaNoy
    • Top 200 Contributor
    • Joined on Sat, Sep 10 2011
    • SBMA, Philippines
    • Posts 41
    • Points 940
    Re: Check Parallel lines if intersect Reply

    Thanks Craig.

    Well I guess doing what you suggested is problem.

    If its ok for you, can u give me an example?

     

    jerald 

    • Post Points: 20
  • Thu, May 23 2013 9:30 AM

    • aCraig
    • Top 50 Contributor
    • Joined on Sat, Aug 16 2008
    • Pepperell, MA
    • Posts 132
    • Points 2,070
    Re: Check Parallel lines if intersect Reply

    Get the vector of the line (marron/yellow)  for this example the line has coords of ((1,2) (4,4))

    v = (x2-x1), (y2-y1)  = (3, 2))

    v(perp) = (-2, 3) or (2, -3)

    To create a line that starts an one of the points, say (1, 2) to get the end point add the v(perp) to the start point (1-2, 2+3) or (-1, 5). If you want a longer or shorter line scale the vector. 

    You can also use unit vector and magnitude but this should be easier. Pull out your Calculas II textbook or search the web for vector math.

    Regards,

    Craig

    • Post Points: 20
  • Thu, May 23 2013 9:55 PM

    • eDaNoy
    • Top 200 Contributor
    • Joined on Sat, Sep 10 2011
    • SBMA, Philippines
    • Posts 41
    • Points 940
    Re: Check Parallel lines if intersect Reply

    thank you Craig...

    Will try this approach maybe sometime...

    I used axlTransform as last option.

     

    jerald 

    • Post Points: 20
  • Sun, May 26 2013 11:09 PM

    • D912349
    • Top 150 Contributor
    • Joined on Sat, Nov 24 2012
    • Posts 47
    • Points 800
    Re: Check Parallel lines if intersect Reply

    Noy,

    Try this approach when you do the function..

    -> remember that lines that are perpendicular have negative reciprocal of the other..

    ex:

    slope1 = - 1/slope2 (given that line of slope1 is perpendicular with slope2)

    ->also consider using slope intercept form in deriving your function

    slope intercept form -> y = mx + b

    where m is the slope and b is the y intercept..

    With this 2 equations, you can now combine it.. You can set the intersection point of the orange line and dotted line as your common point. because this point both lies on the 2 perpendicular lines.. 

    I think this information is enough to solve for the other end of the dotted line.

    Hope this helps..

    Regards,  

    • Post Points: 5
Page 1 of 1 (8 items)
Sort Posts:
Started by eDaNoy at 21 May 2013 08:28 AM. Topic has 7 replies.