简体   繁体   English

如何获得曲线和直线之间的交点?

[英]How to get an intersection point between a curve and a line?

I performed a tensile tests of the material and here is my data. 我对材料进行了拉伸测试,这是我的数据。 I need to determine the intersection of line with my data, this will give me my yield stress. 我需要确定与数据的交点,这会给我带来屈服压力。 The data is written in form of: 数据以以下形式写入:

 A = -0.0033   -2.6120
     -0.0037   -2.6309
     -0.0051   -2.6246
     -0.0018   -2.6309
     -0.0030   -2.6120
     -0.0004   -2.5806
     -0.0036   -2.6120
     -0.0026   -2.6120
     -0.0024   -2.5995
     -0.0020   -2.5618... etc.

And a line, y=a*(x-0.2)+b . 一条线y=a*(x-0.2)+b

I have tried to with intersect function after interpreting the line as a: 在将行解释为后,我尝试使用intersect函数:

C =  0  -19.3677
1.0000   48.4377
2.0000  116.2431`

But it does not helps. 但这没有帮助。 Any suggestions of the problem solution? 对问题解决方案有什么建议吗? I have a bunch of an experimental data and would like to write it as a macro. 我有一堆实验数据,想将其写为宏。 The data has the same pattern of the curve. 数据具有相同的曲线样式。

Image is here: 图片在这里:

路口

Do you know how to calculate the intersection of two lines? 您知道如何计算两条线的交点吗? If so, you can just do this for all the segments that form the curve, and chose the one that makes sense. 如果是这样,您可以对构成曲线的所有线段进行此操作,然后选择一个有意义的线段。

a) Binary search through your data along the line a)根据您的数据进行二进制搜索

b) Locate the segments of data nearest the line b)找到最靠近直线的数据段

c) Intersect the lines c)相交线

Binary search will find the mid-point of the approximate curve between the nearest data segments, this is similar to calculating a Bezier curve at any rate. 二进制搜索将找到最接近的数据段之间的近似曲线的中点,这类似于以任何速率计算贝塞尔曲线。

If accuracy maters, do it analytically. 如果精度很重要,请进行分析。

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

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