fitCircle: Fitting circle into point configuration

Description Usage Arguments Value References Examples

View source: R/fitCircle.R

Description

Utility function for fitting a circle into 2D point configurations.

Usage

1
fitCircle(x, y)

Arguments

x

Vector with x-coordinates

y

Vector with y-coordinates

Value

cx

x-coordinate center

cy

y-coordinate center

radius

circle radius

References

Pratt, V. (1987). Direct least-squares fitting of algebraic surfaces. Computer Graphics, Vol. 21, pages 145-152.

Examples

1
2
3
4
5
6
7
## Dataset on Schwartz values:
require(plotrix)
valsD <- 1 - cor(indvalues)
fit <- mds(valsD)
plot(fit, main = "MDS Value Circle")
circle <- fitCircle(fit$conf[,1], fit$conf[,2])
draw.circle(circle$cx, circle$cy, radius = circle$radius, border = "gray") 

Example output

Loading required package: plotrix

Attaching package: 'smacof'

The following object is masked from 'package:base':

    transform

smacof documentation built on Feb. 11, 2021, 3 a.m.