Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Point projection on Bézier curves can be easily accomplished using Newton Iteration to try to minimize the dot product between the vector connecting the point P and its projection on curve C and the curve tangent vector C' at the same parameter. When the dot product is zero we have a perpendicular projection.

Am I right saying that this approach cannot work for points on the curve itself? And that if the point P is on the curve I need to try to minimize the distance between the two points P and C?

Is there any other approach that works in all cases, both for points on the curve and away from the curve without involving a distance check? In my case it's impossible to estimate a tolerance for the distance a priori.

Thanks.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

I think your approach should work fine also for points on the curve. Since the zero comes not from the tangent vector but from the difference between the point and the projection, you're effectively just finding the zero of that difference, which should get you to the point. Why do you expect problems?

share|improve this answer
    
I am following the approach of page 231 of this book: books.google.it/…. By the way, even my code fails for example if the curve is straight. Do you find it reasonable? –  Alberto Dec 23 '11 at 9:08
    
@devdept: You said you were looking for the dot product to be zero; the book uses the cosine -- that's more likely to cause problems when the point is on the curve. I'd use the dot product; if you want to use the cosine, you probably can't use Newton's method, since the cosine is a step function when the point is on the curve, or a steep sigmoid when it's close, and you can't find the zeros of those using Newton's method. Regarding your code failing for straight curves -- is this with the point on or off the line? –  joriki Dec 23 '11 at 9:20
    
@ joriki: it's on the curve but what you say makes sense. Do you know an article explaining how to do point projection using dot product? I'm still wandering why this famous book explains this approach. As mentioned above, what I am really looking for is to get rid of point distance checks. –  Alberto Dec 23 '11 at 14:26
    
@devdept: I don't know an article, but I'd just do it the way you proposed in the question, finding the zeros of the dot product using Newton's method. Have you tried that? (BTW, the author of a post automatically gets notified of comments; no need to ping in that case.) –  joriki Dec 23 '11 at 14:28
    
@joriky: I will try, thanks. (BTW I don't even know what ping means...) –  Alberto Dec 23 '11 at 14:51

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.