#
MATH GURUS - help!

**1**of

**1**[ 14 posts ]

I need a math guru to help me with a problem related to cubic bezier curves.

Say I have a cubic bezier with control points a,b,c,d, and I want to build a second cubic bezier from that with control points e,f,g,h, where the second bezier follows a path that is offset exactly 1 unit left of the first bezier. In other words, at any point on the first bezier, you can calculate the normal and follow the normal 1 unit in the positive (or negative in a flip case) direction and you will meet the second bezier.

Obviously, control points e and h are trivial to generate from points a and d. I just offset them directly since the curve passes directly through them. The middle control points are where I'm curious.

Does anyone know an equation that I can use to generate points f and g, or the process that would work? If the result is off by a few % in either direction at any point, in the name of simplifying the process, that's okay.

Cheers

According to Wiki, the offset of a Bezier is not necessarily a Bezier:

Here is a starting point (but I guess maybe it was you who asked this question?):

http://stackoverflow.com/questions/4148831/how-to-offset-a-cubic-bezier-curve

EDIT: Seems that I might have found the sort of thing you were looking for:

http://seant23.wordpress.com/2010/11/12/offset-bezier-curves/

Thanks I found the first page you posted, apparently this is not an uncommon problem to want to solve. Since it's an academic document I was hoping to find some source code so I wouldn't have to spend the whole weekend digesting the academic document. The second guy solved the problem in a way I'm not totally comfortable with (first tessellate the curve then add or remove line segments) but someone posted a response on the page to another page that seems to have a solution for the problem. Now I have to figure out that page I'm a programmer and don't want to hear about the math, I prefer to see the code

Thanks, that's the one I was just looking at. I've already realized though that I cannot adequately represent the offset as a Bezier curve so I'm going to attempt to do it by offsetting a set of line segments and then cutting out ones that intersect. The new question is what the fastest way is to cull the "between" segments or partial segments of intersections. That issue is illustrated here:

http://cagd.cs.byu.edu/~557/text/ch8.pdf

Yeah I looked at that, but I was hoping for something with a smaller O. Especially since I'd have to snip off and detect hard edges where the offset curve crosses itself.

I'm thinking about building polygons *around* the line and using a fragment shader to rasterize the curve detail. A fragment shader can decide how close it is to the center curve. Not positive on performance or details of the algorithm.

Yeah I looked at that, but I was hoping for something with a smaller O. Especially since I'd have to snip off and detect hard edges where the offset curve crosses itself.

I'm thinking about building polygons *around* the line and using a fragment shader to rasterize the curve detail. A fragment shader can decide how close it is to the center curve. Not positive on performance or details of the algorithm.

I guess the standard way to render a mathematical curve with some small but finite thickness is to draw an offset polygon surrounding the line. As long you can calculate the derivatives of the parametric curve, you have an exact formula for the tangent and normal vectors at each point along the curve. Then the main issues is deciding how many points to use and how to deal with the offset curve possibly intersecting itself and turning "inside out" on the concave side of the curve.

Those tests of determining a pattern. Sometimes it is several examples of images. There is multiple choice to select the correct image that fits the pattern.

This test is also done with numbers. It shows several numbers, and then to pick the correct number from multiple choice that is the next number in the pattern.

What if someone who has an extraordinary talent to look at the winning results from the lottery and see a pattern in the randomness of numbers, and, be able to see the most probable next result.

This test is also done with numbers. It shows several numbers, and then to pick the correct number from multiple choice that is the next number in the pattern.

What if someone who has an extraordinary talent to look at the winning results from the lottery and see a pattern in the randomness of numbers, and, be able to see the most probable next result.

Fill in the blanks:

3 _ 4 _ 5 _

**next**(fill in this blank -)

If you said 6 you are a pedestrian. If you said 9 you are probably a mathematician. Pi = 3.1415962...

ruveyn

I am not being sarcastic.

Now you know why I don't necessarily take I.Q. testing seriously.

A truly outstanding brilliant genius would probably fail most I.Q. tests. (not that I am such a person, I am not)

ruveyn

Last edited by ruveyn on 08 Oct 2012, 5:17 am, edited 1 time in total.

There is no pattern in randomness. That's why it's random.

But to continue with your example of the lottery. Suppose that the official that draws the lottery numbers pushes a button to generate a number. The computer the button is attached to looks at the time in microseconds that the button was pushed, takes the last 2 digits and uses this as the next number. The official then takes a sip of his drink, checks his watch, reloads a news-website, or whatever and repeats the process. How are you going to predict anything if the sequences of numbers are generated in this way?

Note that this is obviously not how lottery numbers are generated, but it is a decent enough example of a random number generator that is extremely easy to implement and that will be more than random enough so that no human will ever be able to predict the next result.

**1**of

**1**[ 14 posts ]

Similar Topics | |
---|---|

Any Win 7 gurus here? |
05 May 2020, 2:10 am |

fitness gurus pt. II |
27 Oct 2009, 10:34 am |

Maths Gurus - Help a brother out? |
18 Aug 2008, 4:44 am |

Any Gentoo gurus willing to help a noob? |
11 Jan 2009, 10:26 pm |