ellipse: Get coordinates of error ellipse for plotting

Description Usage Arguments Value Examples

View source: R/errorellipse.R

Description

Constructs an error ellipse at a given confidence level from its centre and covariance matrix

Usage

1
ellipse(x, y, covmat, alpha = 0.05, n = 50)

Arguments

x

x-coordinate (scalar) for the centre of the ellipse

y

y-coordinate (scalar) for the centre of the ellipse

covmat

the [2 x 2] covariance matrix of the x-y coordinates

alpha

the probability cutoff for the error ellipses

n

the resolution (number of segments) of the error ellipses

Value

an [n x 2] matrix of plot coordinates

Examples

1
2
3
4
5
6
x = 99; y = 101;
covmat <- matrix(c(1,0.9,0.9,1),nrow=2)
ell <- ellipse(x,y,covmat)
plot(c(90,110),c(90,110),type='l')
polygon(ell,col=rgb(0,1,0,0.5))
points(x,y,pch=21,bg='black')

Example output



IsoplotR documentation built on Dec. 9, 2018, 1:04 a.m.