Hi pannigh,

The following might get you started:

> x0 <- uniroot(function(x) 100-0.5*x - (150- x), c(0, 150))$root
> x0
[1] 100
> 100- 0.5*x0
[1] 50

HTH,
Jorge.-


On Wed, Apr 25, 2012 at 1:01 PM, pannigh <> wrote:

> Dear List,
> I know this is not the first post on this topic, but I need basic help I
> guess. Assuming the simple case of two lines with one intercept, how can I
> make R calculate this intercept, NOT using locator().
>
> par (xaxs="i", yaxs="i")
> plot( 1, bty="n" ,xlim=c(0,300) , ylim=c(0,300) , xlab="X", ylab="Y")
>    curve(100-0.5*x, -50,250, add=T, col="blue")
>    curve(150- x   , -50,250, add=T, col="red")
>
> I want R to come up with the coordinates X=100, Y=50.
>
> Thank you for your help!
>
>
>
> --
> View this message in context:
> http://r.789695.n4.nabble.com/Intercept-between-two-lines-tp4587343p4587343.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to