[R] Intersection between circle and line?
dwinsemius at comcast.net
Mon Sep 26 17:40:44 CEST 2011
On Sep 26, 2011, at 11:03 AM, Chris82 wrote:
> Dear R users,
> I am thinking about an easy and especially fast solution to
> calculate the
> x,y coordinates of the interesection between the borders of the red
> and the line.
This would seem to be the solution to two simultaneous equations : one
a quadratic and the other linear. I suspect tenth-grade algebra would
be the level; Looking for something to minimize the mental strain also
succeeds easily. Googling on "intersection of line and circle"
produces this analytic approach (and there are many other webpages.)
> x <- c(-12,-6,-1,0,13,21)
> y <- c(-19,-10,-5,0,9,25)
> At the moment I am interpolating the points which gives the basis
> coordinates of the line. I do this with approx() and then I check
> point is within the circle and which one is not. The probleme is,
> that this
> method is not really exact and for my dataset it takes too much time.
> With best regards
> View this message in context: http://r.789695.n4.nabble.com/Intersection-between-circle-and-line-tp3844063p3844063.html
> Sent from the R help mailing list archive at Nabble.com.
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
David Winsemius, MD
West Hartford, CT
More information about the R-help