level 12
如何编程画出从点A到点B的随机路径?要求是生成路径的方式也是随机的,是理论上可以生成到空间中任意点的路径的方式。
想了想我觉得这个问题就是个纯粹的锈规作图题,还是最简单的那种(捂脸)不过仍然求其他思路……
2015年01月01日 01点01分
1
level 12
-_-||没看懂
---
Across the Great Wall we can reach every corner in the world.
Inside the Great Wall we are the only unreachable corner isolated from the world.
2015年01月01日 04点01分
3
指定起讫点生成随机轨迹-_-||
2015年01月01日 05点01分
level 12
我觉得不可能生成任意路径…总有无法生成的路径……因为路径总数是不可列的一样……同理你不可能生成任意实数
---
Across the Great Wall we can reach every corner in the world.
Inside the Great Wall we are the only unreachable corner isolated from the world.
2015年01月01日 05点01分
4
这没关系吧0 0 只要是随机路径就行
2015年01月01日 06点01分
回复 mathfree :那么怎么随机都可以啦(╯3╰)
2015年01月01日 06点01分
怎麼随机都行啦....加一个if (x-x1)==0 and (y-y1)==0. 不过如果用浮点而不是整数的话,基本没什麼可能到达终点~~
2015年01月01日 07点01分
回复 tamyiuchau :所以说我想到的是有限的方法……
2015年01月01日 07点01分
level 12
这样,随机一个中间点数,再随机那么多的中间点,然后按顺序把它们连起来
---
Across the Great Wall we can reach every corner in the world.
Inside the Great Wall we are the only unreachable corner isolated from the world.
2015年01月02日 02点01分
8
……好像也可以……不过要不要限制步长?
2015年01月02日 16点01分
回复 mathfree :中间点数大致相当于步长了…虽然不知道每步多长
2015年01月02日 16点01分
回复 s_wordfeng :不确定也挺危险的~
2015年01月03日 04点01分