dmurdoch/ellipse

ellipse.default(): center has no effect

Closed this issue · 4 comments

dwoll commented

Many thanks for developing ellipse and for putting the source on GitHub! I'm wondering if the addition of argument center is as intended. centre is used on line 27/28

matrix(c(t * scale[1] * cos(a + d/2) + centre[1], t * scale[2] *

However, there is no previous assignment centre <- center conditional on center being supplied but not centre. Consider

> e1 <- ellipse:::ellipse.default(0.8, center=c(1, 2))
> e2 <- ellipse:::ellipse.default(0.8, center=c(0, 0))
> all.equal(e1, e2)
[1] TRUE

Using centre instead really gives different ellipses.
Note there is a typo in the warning on line 7 (one should be center)

warning("Specify centre or centre, not both. The value from centre will be used.")

Thanks in advance!

Yes, you're right. I'll fix it.

Now fixed. I'll wait a few days to see if anything else turns up before sending this to CRAN.

dwoll commented

Thank you very much!

Just accepted by CRAN. Thanks for the report!