As @DWin suggested, there are several implementations for building ellipses (such as the draw.ellipse function in the plotrix package). To find them:
RSiteSearch("ellipse", restrict="functions")
Moreover, the implementation of your own function is quite simple if you know a little geometry. Here is an attempt:
ellipse <- function(xf1, yf1, xf2, yf2, k, new=TRUE,...){
Example:
F1 <- c(2,3) F2 <- c(1,2) plot(rbind(F1, F2), xlim=c(-1,5), ylim=c(-1, 5), pch=19) abline(h=0, v=0, col="grey90") ellipse(F1[1], F1[2], F2[1], F2[2], k=2, new=FALSE, col="red", lwd=2) points((F1[1]+F2[1])/2, (F1[2]+F2[2])/2, pch=3)

source share