fengfan 发表于 2007-4-5 17:12:00

唉,这个我也会,我想要的是怎么通过数学方法判断啊.

jkbanana 发表于 2007-4-6 15:57:00

本帖最后由 作者 于 2007-4-6 16:35:49 编辑 <br /><br /> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt;"></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt;"><font face="Times New Roman"></font><p></p></p><p></p><p></p><font color="#2222dd"></font><p></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt;">数学问题的设定:<p></p></p><p></p><p></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt;"><span style="mso-spacerun: yes;">&nbsp; &nbsp;&nbsp;</span>设直线的两端点分别A和B, 一指示直线的一侧的点为Pref(要判断在直线的那一侧),现在要判断任意点P在直线AB的那一侧?也既是任意点P与指示点Pref是否在直线AB的同一侧的问题.<p></p></p><p></p><p></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt;">解:</p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt;"><span style="mso-spacerun: yes;"><font face="Times New Roman">&nbsp;&nbsp;&nbsp; </font></span>以直线的一端点<font face="Times New Roman">A</font>为起点<font face="Times New Roman">,</font>端点<font face="Times New Roman"><br/>&nbsp;&nbsp;&nbsp;B ,</font>指示点<font face="Times New Roman">Pref </font>和任意点<font face="Times New Roman">P </font>为终点的矢量分别设为<font face="Times New Roman"><b style="mso-bidi-font-weight: normal;">V</b><sub>0</sub>,<b style="mso-bidi-font-weight: normal;"> V</b><sub>1</sub></font>和<font face="Times New Roman"><b style="mso-bidi-font-weight: normal;">V</b><sub>2</sub>. </font>任意点<font face="Times New Roman">P </font>点和指示点<font face="Times New Roman">Pref</font>在直线AB的同一侧的话,外积<br/>&nbsp;&nbsp;<font face="Times New Roman">(<b style="mso-bidi-font-weight: normal;">V</b><sub>0</sub></font>×<font face="Times New Roman"><b style="mso-bidi-font-weight: normal;">V</b><sub>1</sub>)</font> 和 <font face="Times New Roman">(<b style="mso-bidi-font-weight: normal;">V</b><sub>0</sub></font>×<font face="Times New Roman"><b style="mso-bidi-font-weight: normal;">V</b><sub>2</sub>)</font><sub> </sub>的符号相同<font face="Times New Roman">.<p></p></font></p><p></p><p></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt;">总结如下<font face="Times New Roman">:<b style="mso-bidi-font-weight: normal;"><p></p></b></font></p><p></p><p></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt;"><b style="mso-bidi-font-weight: normal;"> </b><font face="Times New Roman">(1)</font> <font face="Times New Roman">&nbsp;&nbsp;<span lang="EN-US">(<b style="mso-bidi-font-weight: normal;">V</b><sub>0</sub></font></span>×<font face="Times New Roman"><b style="mso-bidi-font-weight: normal;">V</b><sub>1</sub>) </font>=<font face="Times New Roman">0</font> <font face="Times New Roman">---</font> 指示点<font face="Times New Roman">Pref</font>在直线AB上<p></p></p><p></p><p></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt;"><b style="mso-bidi-font-weight: normal;"> </b><font face="Times New Roman">(2)</font>  <font face="Times New Roman">&nbsp;<span lang="EN-US">(<b style="mso-bidi-font-weight: normal;">V</b><sub>0</sub></font></span>×<font face="Times New Roman"><b style="mso-bidi-font-weight: normal;">V</b><sub>2</sub>) </font>=<font face="Times New Roman">0</font> <font face="Times New Roman">---</font> 任意点<font face="Times New Roman">P</font>在直线AB上<p></p></p><p></p><p></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt;"><b style="mso-bidi-font-weight: normal;"> </b><font face="Times New Roman">(3)</font> <font face="Times New Roman">&nbsp;&nbsp;<span lang="EN-US">(<b style="mso-bidi-font-weight: normal;">V</b><sub>0</sub></font></span>×<font face="Times New Roman"><b style="mso-bidi-font-weight: normal;">V</b><sub>1</sub>) </font><b style="mso-bidi-font-weight: normal;">·</b><font face="Times New Roman"><b style="mso-bidi-font-weight: normal;">&nbsp;</b>(<b style="mso-bidi-font-weight: normal;">V</b><sub>0</sub></font>×<font face="Times New Roman"><b style="mso-bidi-font-weight: normal;">V</b><sub>2</sub>) </font>><font face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;<span lang="EN-US">0</font></span> <font face="Times New Roman">---</font> <font face="Times New Roman">&nbsp;<span lang="EN-US">P<sub>ref</sub></font></span>和<font face="Times New Roman">P</font>在直线AB的同一侧    <font face="Times New Roman"><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span lang="EN-US">(<b style="mso-bidi-font-weight: normal;">V</b><sub>0</sub></font></span>×<font face="Times New Roman"><b style="mso-bidi-font-weight: normal;">V</b><sub>1</sub>) </font><b style="mso-bidi-font-weight: normal;">·</b><font face="Times New Roman"><b style="mso-bidi-font-weight: normal;">&nbsp;</b>(<b style="mso-bidi-font-weight: normal;">V</b><sub>0</sub></font>×<font face="Times New Roman"><b style="mso-bidi-font-weight: normal;">V</b><sub>2</sub>) </font><<font face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp; 0</font> <font face="Times New Roman">---</font> <font face="Times New Roman">&nbsp;<span lang="EN-US">P<sub>ref</sub></font></span>和<font face="Times New Roman">P</font>不在直线AB的同一侧<p></p></p><p></p><p></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt;">式中<font face="Times New Roman">:<br/>&nbsp;&nbsp;&nbsp;</font>×为矢量的外积运算符<font face="Times New Roman">,<br/>&nbsp;&nbsp;&nbsp;</font><b style="mso-bidi-font-weight: normal;">·</b>为矢量的内积运算符<font face="Times New Roman">.</font></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt;"><font face="Times New Roman">******************************************************************</font></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt;"><font face="Times New Roman">另外,正如楼上所说,判断点在<span style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'MS Mincho'; mso-hansi-font-family: 'MS Mincho'; mso-font-kerning: 0pt;">直线的一侧问题,只对2维空间的线有意义,</font></span></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt;"><font face="Times New Roman"><span style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'MS Mincho'; mso-hansi-font-family: 'MS Mincho'; mso-font-kerning: 0pt;">在3维空间里,应讨论在面的那一侧问题.</font></span></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt;"><font face="Times New Roman"><span style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'MS Mincho'; mso-hansi-font-family: 'MS Mincho'; mso-font-kerning: 0pt;"></font></span></p>

天龙八部 发表于 2007-8-27 12:04:00

嘻嘻哈哈,不错,不错

兰州人 发表于 2007-8-27 14:22:00

fengfan发表于2007-4-5 17:12:00static/image/common/back.gif唉,这个我也会,我想要的是怎么通过数学方法判断啊.

<p>本人数学不好,能否将数学方法用二元表示出来,谢谢.</p>

arming_hz 发表于 2007-8-27 23:32:00

<p>左右方向是相对前进方向的,只要指定了前进方向就可以知道左右(比如指定前进方向是从直线的起点到终点).判断点在直线的左侧还是右侧是计算几何里面的一个最基本算法.使用矢量来判断.</p><p>&nbsp; 定义:平面上的三点P1(x1,y1),P2(x2,y2),P3(x3,y3)的面积量:&nbsp;&nbsp;&nbsp;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|x1&nbsp;&nbsp;&nbsp;x2&nbsp;&nbsp;&nbsp;x3|&nbsp;&nbsp;&nbsp;<br/>S(P1,P2,P3)=|y1&nbsp;&nbsp;&nbsp;y2&nbsp;&nbsp;&nbsp;y3|=&nbsp;(x1-x3)*(y2-y3)-(y1-y3)(x2-x3)&nbsp;&nbsp;&nbsp;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|1&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;&nbsp; 1| &nbsp; </p><p><br/>&nbsp; 当P1P2P3逆时针时S为正的,当P1P2P3顺时针时S为负的。 &nbsp; <br/>&nbsp; &nbsp; <br/>&nbsp; 令矢量的起点为A,终点为B,判断的点为C, &nbsp; <br/>&nbsp; &nbsp; &nbsp; &nbsp; 如果S(A,B,C)为正数,则C在矢量AB的左侧; &nbsp; <br/>&nbsp; &nbsp; &nbsp; &nbsp; 如果S(A,B,C)为负数,则C在矢量AB的右侧; &nbsp; <br/>&nbsp; &nbsp; &nbsp; &nbsp; 如果S(A,B,C)为0,则C在直线AB上。</p><p></p>

fl202 发表于 2018-2-7 15:40:25

见以下链接:
http://bbs.mjtd.com/forum.php?mod=viewthread&tid=176590&page=1&extra=#pid809120
页: 1 [2]
查看完整版本: [求助]请问怎么判断任意一点在直线的哪一侧?