LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Fit 2D data in to Circle



altenbach wrote:
 
(The code would be quite a bit simpler of you would use complex data)


Here's a version that uses complex data. No loops! 😄
 
 
 


Message Edited by altenbach on 03-10-2008 05:27 PM
Download All
Message 11 of 30
(4,136 Views)

Thanks for the response, that helped me alot.

Just another question, How can  I show the center value and the radius in the plot ?

0 Kudos
Message 12 of 30
(4,105 Views)
There are many possibilties.
 
To draw a line, you could use image commands with the "Plot images" functionality.
 
To mark the center you could place a cursor or use annotations.
0 Kudos
Message 13 of 30
(4,098 Views)
Thanks for the reply,

I looked at that example but still I am able to do it.Smiley Sad
Could you explain how I can place the marker to show the position of the center and draw a line to show the radius?

Thanks
0 Kudos
Message 14 of 30
(4,047 Views)


Maryam hosseini wrote:
Could you explain how I can place the marker to show the position of the center and draw a line to show the radius?

An easy solution would be to just draw a third plot from the center to the circle. If you use a plot with visible point style, the center will show up just fine. Modify as needed.


Message Edited by altenbach on 04-03-2008 08:56 AM
Download All
Message 15 of 30
(4,038 Views)
Thanks for the response.Smiley Happy Helped alot
0 Kudos
Message 16 of 30
(4,023 Views)

Hello,

 

this is great; helped me out a lot!

 

I'm trying to background substract the form of a circle from data we acquire and was wondering if you know what the best way to do that is.

 

We're working with x,y data (cartesian coordinate system) and have used polynomials in the past but they can remove some fine structure from the data.

Polynomials also aren't consistent with the expected shape of the data; should be an arc, but not like Noah's! ....so its more accurate to use the equation of a circle than the polynomials.

 

So the data we have is in the form of an arc of a circle (not a full circle) with a typical arc angle range between 35 -145 degrees.

 

I've attached a block diagram snapshot of my best attempt so far but it seems that the the form corrected data is very close (if not identical) to what I get when using a 2nd order polynomial! Not sure if thats correct (expected it to be a bit different) but figure there must  be an error in my approach.

 

Have been troubleshooting for some time and have been literally going in circles trying to figure out what I've messed up.

 

Any help would be appreciated.....thanks!

 

best

SS

0 Kudos
Message 17 of 30
(3,853 Views)

Can you show us some typical data or even attach your VI (containing some typical data). How many degrees does you "arc" cover? If it's just a shallow "banana", a second order polynomial should work equally well.

 

The circle fit is much more universal and works even in the case where you have multiple distinct y's for some of the x (e.g. if the arc is near vertical).

0 Kudos
Message 18 of 30
(3,850 Views)

Yup I'll post sample data and the vi tomorrow....

 

The angle range that the arc covers is generally between 35 -145 degrees.

 

best

SS

 

0 Kudos
Message 19 of 30
(3,845 Views)

OK I've attached a the VI with some sample data (should be the default values).

I've tried to figure out what was wrong and think I made the form fit worse! Not sure what I changed but the form subtraction doesn't seem to do anything....

 

thanks for the help...

 

best

SS

 

 

 

Download All
0 Kudos
Message 20 of 30
(3,825 Views)