[R-sig-Geo] Find a circle center with spatial points
Adrien Inacio
inacio.adrien at gmail.com
Mon Mar 21 15:00:07 CET 2016
Hello Chris,
Thanks for your help,
I try to find how I can use the java script but I don't really understand
these parts:
"After download you should for standalone compilation delete line 37
"package org.spaceroots;"
compile it with:
*" javac CircleFitter.java -Xlint:uncheckedthen you can run it with:java
CircleFitter input.file"*
*"grab the output in a file using a OS depending pipe"*
Have I to download an application wich permit to work on java script, or
all can be done with R (I have never work with java so i'm a little bit
lost).
Thank you again.
Adrien I.
Cet e-mail a été envoyé depuis un ordinateur protégé par Avast.
www.avast.com
<https://www.avast.com/fr-fr/lp-safe-emailing-2109?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=OA-2109-A>
<#DDB4FAA8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
2016-03-18 23:28 GMT+01:00 Chris Reudenbach <reudenbach at uni-marburg.de>:
> Oops :-[ , Barry thanks for clarification , I got it now.
>
> I don't understand the math either but as a kind of "reparation"
> for not reading well enough I found the authors java code.
> https://www.spaceroots.org/documents/circle/CircleFitter.java
> After download you should for standalone compilation delete line 37
> "package org.spaceroots;"
> compile it with:
>
> javac CircleFitter.java -Xlint:unchecked
>
> then you can run it with:
>
> java CircleFitter input.file
>
> The input data should be formated like:
>
> # input
> # x y
> 0 5
> 1 4.5
> 2.5 4
> 3 3.5
> 4 2
> 5 0
>
> the above input yields
>
> initial circle: -001.69467803 -000.69446643 006.23578103
> converged after 7 iterations
> final circle: -001.34339845 -001.34426151 006.44308386
> with the format x,y,radius
>
> which at least make sense with respect to the data.
>
> You easily can run it from R by system() and grab the output in a file
> using a OS depending pipe
> or you may run it using the rJava package which could be more complex.
>
> cheers Chris
>
> if you want you can call it from R with javaR
>
>
> Am 18.03.2016 um 20:11 schrieb Barry Rowlingson:
>
>> On Fri, Mar 18, 2016 at 6:49 PM, Chris Reudenbach
>> <reudenbach at uni-marburg.de> wrote:
>>
>>> Because it seems to be an arc and not a circle issue that you can solve
>>> the
>>> problem by
>>> picking arbitrary two points of your assumed "arc" then construct
>>> (calculate) the perpendicular bisector of
>>> the line between them and do so for another arbitrary two points of the
>>> assumed "arc".
>>>
>>> The intersection of the perpendicular lines is the assumed center of the
>>> arc.
>>>
>>> If you iterate over all points this should be a pretty good estimation of
>>> the real center.
>>>
>> This is the "sample 3 points and find the fitted circle" idea, you
>> are likely to get massive "outliers" and if you take the mean
>> coordinate it could fail horribly. See the paper I linked to for an
>> example. They use the median to get an initial "robust" estimate of
>> x,y,R, and then use some specialised optimisation to improve the
>> estimate - you can't just throw it into "optim"!
>>
>> Not sure I understand the maths in it yet though....
>>
>> Barry
>>
>>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
[[alternative HTML version deleted]]
More information about the R-sig-Geo
mailing list