简体   繁体   English

R的交叉点

[英]Points of intersection in R

This might be a stupid question... 这可能是一个愚蠢的问题......

I've two vectors containing Y coords X is simply 1:8 我有两个包含Y坐标的矢量X只是1:8

I've added the lines to a plot area and would like to identify the point of intersection of the two lines. 我已将线条添加到绘图区域,并希望识别两条线的交点。

Is there a default package to find this? 有没有找到这个的默认包?

Thanks 谢谢

The intersection of two lines is found analytically by solving the two linear equations which define the lines. 通过求解定义线的两个线性方程,可以解析地找到两条线的交点。 I'll leave the math as an exercise to the OP. 我会把数学作为练习留给OP。

If you want to use a very helpful and powerful package, you could read up on the package spatstat . 如果你想使用一个非常有用和强大的包,你可以阅读包spatstat Once you've converted your lines into psp objects, use spatstat:crossing.psp to find intersections. 将线条转换为psp对象后,使用spatstat:crossing.psp查找交叉点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM