文件名称:triangle-program
-
所属分类:
- 标签属性:
- 上传时间:2013-03-28
-
文件大小:20.04kb
-
已下载: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/
triangle program/2/
triangle program/2/2/
triangle program/2/2.sln
triangle program/2/2.suo
triangle program/2/2/2.csproj
triangle program/2/2/bin/
triangle program/2/2/bin/Debug/
triangle program/2/2/bin/Debug/2.exe
triangle program/2/2/bin/Debug/2.pdb
triangle program/2/2/bin/Debug/2.vshost.exe
triangle program/2/2/obj/
triangle program/2/2/obj/2.csproj.FileList.txt
triangle program/2/2/obj/Debug/
triangle program/2/2/obj/Debug/2.exe
triangle program/2/2/obj/Debug/2.pdb
triangle program/2/2/obj/Debug/TempPE/
triangle program/2/2/Program.cs
triangle program/2/2/Properties/
triangle program/2/2/Properties/AssemblyInfo.cs
triangle program/程序说明.txt
triangle program/2/
triangle program/2/2/
triangle program/2/2.sln
triangle program/2/2.suo
triangle program/2/2/2.csproj
triangle program/2/2/bin/
triangle program/2/2/bin/Debug/
triangle program/2/2/bin/Debug/2.exe
triangle program/2/2/bin/Debug/2.pdb
triangle program/2/2/bin/Debug/2.vshost.exe
triangle program/2/2/obj/
triangle program/2/2/obj/2.csproj.FileList.txt
triangle program/2/2/obj/Debug/
triangle program/2/2/obj/Debug/2.exe
triangle program/2/2/obj/Debug/2.pdb
triangle program/2/2/obj/Debug/TempPE/
triangle program/2/2/Program.cs
triangle program/2/2/Properties/
triangle program/2/2/Properties/AssemblyInfo.cs
triangle program/程序说明.txt
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.