S.O.S. Mathematics CyberBoard

Your Resource for mathematics help on the web!
 It is currently Wed, 22 May 2013 22:25:12 UTC

 All times are UTC [ DST ]

 Page 1 of 1 [ 2 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: define the leeway of a linePosted: Wed, 25 May 2011 07:55:52 UTC
 S.O.S. Newbie

Joined: Sun, 27 Mar 2011 05:00:52 UTC
Posts: 4
I'm trying to create or locate an algorithm to render the "+/- leeway" around a two-dimensional vector line. The horizontal and vertical leeway values are arbitrary, as is the line's path (although it will not overlap or loop back on itself).

--

Here are some diagrams to help the above make sense:

The first diagram shows the original line, with the control points marked with dots.

The second diagram shows "leeways" around each control point; in this case the allowed variation in the vertical direction is about twice the allowed variation in the horizontal direction, creating a rectangle around each point.

As a last resort I could just render each of those rectangles, and join them up to make the leeway "volume" continuous. The third diagram connects corner lines to each rectangle, which shows that the volume I'm aiming for is contained within all the quads and various surfaces that could be created by connecting the quads together.

I call that a last resort because I need this to be as fast as possible, meaning that I need the simplest geometry possible. This example has less than 20 control points, but I could be dealing with lines that contain thousands.

The fourth diagram shows that the simplest geometry is found by tracing the very outermost corners above and below the line. Although the two corners that are < 90 degrees have locations that are not at the corner of a rectangle (they're at the intersection of two lines).

Finally, the last diagram shows what I'm aiming for, with the lines of the previous diagram easily turned into a strip of triangles suitable for rendering with OpenGL or whatever.

--

I've been trying to figure out some rules to define the two lines of diagram 4, without success so far.

Any thoughts appreciated.

Top

 Post subject: Posted: Fri, 27 May 2011 13:39:28 UTC
 S.O.S. Newbie

Joined: Sun, 27 Mar 2011 05:00:52 UTC
Posts: 4
Update: I got this working. Problem solved.

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 2 posts ]

 All times are UTC [ DST ]

Who is online

Users browsing this forum: No registered users

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forum

Search for:
 Jump to:  Select a forum ------------------ High School and College Mathematics    Algebra    Geometry and Trigonometry    Calculus    Matrix Algebra    Differential Equations    Probability and Statistics    Proposed Problems Applications    Physics, Chemistry, Engineering, etc.    Computer Science    Math for Business and Economics Advanced Mathematics    Foundations    Algebra and Number Theory    Analysis and Topology    Applied Mathematics    Other Topics in Advanced Mathematics Other Topics    Administrator Announcements    Comments and Suggestions for S.O.S. Math    Posting Math Formulas with LaTeX    Miscellaneous