简体   繁体   English

知道 Matlab 中的给定点在哪个区域

[英]know in which zone is a given point in Matlab

Given a1x + b1y + c1 =0 the line AB a2 x + b2y + c2=0 and the line CD给定 a1x + b1y + c1 =0 线 AB a2 x + b2y + c2=0 和线 CD

how would one write a program to know in which zone is a given point (the lines intersect making an X shape)如何编写程序来知道给定点位于哪个区域(线相交形成 X 形)

Fill in the value for x and y of a given point, so if point is (1,2):填写给定点的 x 和 y 的值,所以如果点是 (1,2):

a1 x 1 + b1 x 2 + c1 a1 x 1 + b1 x 2 + c1

  • If this is > 0, than the point is above line 1如果大于 0,则该点位于第 1 行上方
  • If this is < 0, than the point is below line 1如果这是 < 0,则该点位于第 1 行下方
  • If this is ==0, than the point is on line 1如果这是 ==0,则该点位于第 1 行

Same goes for line 2第 2 行也是如此

a2 x 1 + b2 x 2 + c2 a2 x 1 + b2 x 2 + c2

  • If this is > 0, than the point is above line 2如果大于 0,则该点位于第 2 行上方
  • If this is < 0, than the point is below line 2如果这是 < 0,则该点位于第 2 行下方
  • If this is ==0, than the point is on line 2如果这是 ==0,则该点位于第 2 行

And then you can combine both results and know where your point is然后你可以结合这两个结果并知道你的观点在哪里

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

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