Results 1 to 4 of 4

Math Help - How to find the Rectangle Intersection

  1. #1
    Newbie
    Joined
    May 2009
    Posts
    8

    Smile How to find the Rectangle Intersection

    Can i know the formula or way of finding a rectangle intersect with LINE,ARC,RECTANGLE and SPLINE
    Regards,
    ALGATES
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Super Member
    Joined
    Jan 2009
    Posts
    591
    Quote Originally Posted by algates View Post
    Can i know the formula or way of finding a rectangle intersect with LINE,ARC,RECTANGLE and SPLINE
    Regards,
    ALGATES
    Yes, you can.
    Or maybe you can't.

    I'm not being sarcastic; I'm just not aware of your capabilities.
    Plus, I'm sure if you're implying a question or simply making a statement.

    Do you have a specific problem that can be generalized?

    A wild guess is that you have a view port (A RECTANGLE) and you want to know the clipping limit for viewing the: LINE,ARC,RECTANGLE and SPLINE.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    May 2009
    Posts
    8

    Smile just to find intersection of Rectangle and Line

    I need to find Rectangle (X,Y,W,H) intersect with line of starting point (a,b) and ending point (c,d).
    Is there is any steps or formula to work out for this solution?
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Super Member
    Joined
    Jan 2009
    Posts
    591
    Quote Originally Posted by algates View Post
    I need to find Rectangle (X,Y,W,H) intersect with line of starting point (a,b) and ending point (c,d).
    Is there is any steps or formula to work out for this solution?

    One of you best options is to make a sketch.
    A picture is worth more than a few words.

    I have a sketch but am not able to attach it.
    (I have no idea as how to attach or upload an image.)

    There are four possible intersections that can be made from your information: the LINE (a,b)-(c,d) can intersect the two horizontal lines of the rectangle or the two vertical lines of the rectangle.

    The intersection points of interest occur on the line segments of the rectangle.

    With a sketch you can avoid calculations pertinent to the non interesting points.

    The corners of the rectangle:
    (x,y) LowerLeftCorner
    (x,y+h) UpperLeftCorner
    (x+w,y+h) UpperRightCorner
    (x+w,y) LowerRightCorner

    If the LINE (a,b)-(c,d) intersects the lower line of the rectangle:

    It should be obvious that the Y coordinate is going to be y
    (if it were the upper line then the Y coord would by y+h)

    The X coordinate where the line will intersects the lower line of the rectanangle is:

    X = a + (c-a) * (y-b) / (d-b)

    The intersection point is:

    ( a + (c-a) * (y-b) / (d-b) , y)
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Rectangle intersection with curve(Object)
    Posted in the Geometry Forum
    Replies: 3
    Last Post: June 5th 2009, 06:06 AM
  2. rectangle intersection with arc
    Posted in the Geometry Forum
    Replies: 2
    Last Post: June 1st 2009, 10:28 PM
  3. find x in this rectangle
    Posted in the Geometry Forum
    Replies: 2
    Last Post: April 4th 2009, 05:37 AM
  4. Find Dimensions of Rectangle
    Posted in the Pre-Calculus Forum
    Replies: 2
    Last Post: November 8th 2008, 10:13 PM
  5. Find Rectangle Dimensions
    Posted in the Pre-Calculus Forum
    Replies: 2
    Last Post: July 30th 2008, 02:21 PM

Search Tags


/mathhelpforum @mathhelpforum