文件名称:triangle-program
- 所属分类:
- 其他小程序
- 资源属性:
- [Windows] [Visual.Net] [源码]
- 上传时间:
- 2013-03-28
- 文件大小:
- 20kb
- 下载次数:
- 0次
- 提 供 者:
- 枫*
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
题目要求:首先由用户输入六个值,以作三角形的三个顶点坐标,构成一个三角形;然后由用户输入一个点坐标,由程序来判断该点是否在该三角形内,并输出结果,至此,程序运行结束!
算法思想:
1:判断用户输入是否为三角形是根据三角形三边关系(两边之和大于第三边,两边之差小于第三边)来判断。
2:判断点是否在三角形内:将所要判断的点的坐标和三角形一顶点坐标带入该顶点所对应的那条边所在的直线方程中,并将两结果相乘,循环判断三次(每次所选的三角形顶点坐标需不同),得到的三个结果均大于0,则说明:点在三角形中,否则,点不在三角形中。-The subject of the request: the first six values input by the user, in order for the three vertices of the triangle coordinates, to form a triangle coordinates of a point is then entered by the user, by the procedure to determine whether the point within the triangle, and outputs the result, so far, the end of the program run! Algorithm thinking: 1: judgment entered by the user whether the triangle is a triangle triangular relationship (on both sides and is greater than the third side, on both sides of the difference is less than the third side) to determine. 2: determine whether or not the point within the triangle: To determine the coordinates of the point and the triangle vertex coordinates into the linear equation where the vertex corresponding to that edge, and the two results are multiplied cycle to judge three times (each time the selected triangle vertex coordinates need to be different), three results obtained are greater than 0, then: the point in a triangle, o
算法思想:
1:判断用户输入是否为三角形是根据三角形三边关系(两边之和大于第三边,两边之差小于第三边)来判断。
2:判断点是否在三角形内:将所要判断的点的坐标和三角形一顶点坐标带入该顶点所对应的那条边所在的直线方程中,并将两结果相乘,循环判断三次(每次所选的三角形顶点坐标需不同),得到的三个结果均大于0,则说明:点在三角形中,否则,点不在三角形中。-The subject of the request: the first six values input by the user, in order for the three vertices of the triangle coordinates, to form a triangle coordinates of a point is then entered by the user, by the procedure to determine whether the point within the triangle, and outputs the result, so far, the end of the program run! Algorithm thinking: 1: judgment entered by the user whether the triangle is a triangle triangular relationship (on both sides and is greater than the third side, on both sides of the difference is less than the third side) to determine. 2: determine whether or not the point within the triangle: To determine the coordinates of the point and the triangle vertex coordinates into the linear equation where the vertex corresponding to that edge, and the two results are multiplied cycle to judge three times (each time the selected triangle vertex coordinates need to be different), three results obtained are greater than 0, then: the point in a triangle, o
(系统自动生成,下载前可以参看下载内容)
下载文件列表
triangle program
................\2
................\.\2
................\.\2.sln
................\.\2.suo
................\.\.\2.csproj
................\.\.\bin
................\.\.\...\Debug
................\.\.\...\.....\2.exe
................\.\.\...\.....\2.pdb
................\.\.\...\.....\2.vshost.exe
................\.\.\obj
................\.\.\...\2.csproj.FileList.txt
................\.\.\...\Debug
................\.\.\...\.....\2.exe
................\.\.\...\.....\2.pdb
................\.\.\...\.....\TempPE
................\.\.\Program.cs
................\.\.\Properties
................\.\.\..........\AssemblyInfo.cs
................\程序说明.txt