You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using CircleFit
using GLMakie
r =1
N =20
σ =0.05
θs =range(0, 360, N+1)[begin:end-1]
xs = r *cosd.(θs) +randn(N)*σ
ys = r *sind.(θs) +randn(N)*σ
fig, ax, plt =scatter(xs, ys, label="Noisy points", color=Cycled(2))
ax.aspect=DataAspect()
x_center_fit, y_center_fit, r_fit = CircleFit.pratt(xs, ys)
scatter!(x_center_fit, y_center_fit, label="Fitted Center", color=:black, markersize=20)
θs_fit =range(0, 360, 200)#[begin:end-1]lines!(r_fit *cosd.(θs_fit), r_fit *sind.(θs_fit), label="Fitted cicle", color=:black)
leg =Legend(fig[1, 2], ax)
ax.title="True radius = $r. Fitted radius = $(round(r_fit, sigdigits=5))"#$N points on circle with radius $r.\nAdded noise with σ=$σ"display(fig)
Procudes the following plot:
I am sure that such visual examples would be very nice to have in the readme (or on the documentation page).
By the way, this is something that anyone can do, and I am not specifically asking the maintainer(s) of this package to do this. View it more like a todo-note for anyone to take.
The text was updated successfully, but these errors were encountered:
The following code:
Procudes the following plot:
I am sure that such visual examples would be very nice to have in the readme (or on the documentation page).
By the way, this is something that anyone can do, and I am not specifically asking the maintainer(s) of this package to do this. View it more like a todo-note for anyone to take.
The text was updated successfully, but these errors were encountered: