06-15-2020 06:02 PM
Hi,
I'm trying to fit a circle in a dataset to find its radius (c) and centre (a,b). I know I could use the fit sphere.vi but I wanted to try this. In fact I used it with the same dataset and it succesfully (and accurately) obtains both the radius and the center. I've created the equation
and built the fitting vi (Attached) but there's always this -20068 error complaining about the dataset.
Thanks for the help!
06-15-2020 07:37 PM
Did you look up the Error Message? [Help, Explain Errors]. It says "Something is NaN, Not a Number". Look at your formula, Assume c = 0, which reduces the equation to
Y = sqrt (-(X-a)^2) + b. Now assume that you plug in a value of X that is different than a. Do you see a problem, something that might evaluate to "Not a Number"? [Or, possibly, Not a Real Number?]
Bob Schor
06-16-2020 02:27 AM
Hi Bob,
Thanks for your reply. I understand that. It will always happen when trying to fit a circle with a smaller radius than what the imposed coordinates suggests but how the fit sphere.vi bypasses this problem? The equation of a circle is what it is.
Thanks a lot!
06-16-2020 07:38 AM
@cobayatron wrote:
Hi Bob,
I understand that. No, you do not. It will always happen when trying to fit a circle with a smaller radius than what the imposed coordinates suggests but how the fit sphere.vi bypasses this problem? The equation of a circle is what it is.
True, but you were not fitting the equation of a circle, which is a quadratic equation!! Look it up.
Bob Schor
06-16-2020 08:04 AM
Love is in the air! Ok, I'll look it up
06-16-2020 09:58 PM
The equation of a circle with radius r and center at (a, b) is (x-a)² + (y-b)² = r², No square roots here.
Bob Schor
06-17-2020 04:05 AM
06-17-2020 04:07 AM
To get 'r' you need to Square root the whole shebang.
"I put my root beer in a Square cup, now it's just beer."