April 29th, 2011, 10:27 PM
Distance from CubicCurve2D
I'm writing an application which has to know when the user has clicked on a curve that is shown on the screen. I can get a copy of the curve, and the point the user has clicked, but I don't know how I should continue.
First I tried to solve a general equation (to see if a circle and cubic intersected), but that ended up in a horrible mathematical mess. I needed to know if there was a root to a sixth-degree equation between 0 and 1. If it's possible, I have no idea how. If I could get that though, it would be easy.
Then I tried drawing it to an image and checking pixels, but since the view on the screen can be zoomed in and out, and the image method rounded to integers since it uses discrete pixels, it gave incorrect results when zoomed in. Does anyone know how I should proceed?
Tags for this Thread
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!