Yesterday, when I tried to improve my program following my supervisor’s suggestions, I wrote lines of codes which just calculated the position of an object. And this kind of things I have done for many times in this program. But when I test it. All the time I got a really mass picture in which the objects are wrongly positioned. No other reasons could be. However, after many times’ verifications, checking and re-analyzing. I could find nothing goes wrong!
Till the time to go back, I still haven’t got what is wrong with my program. Having English classes this morning, my thought came to this problem again in the class then quickly went back to the class. After lunch, open my computer, check emails, see whether there are something interesting or not and then come back to my program.
Try several ways again. No progress. Suddenly, when I focus on the mass picture the wrong program creates, I found maybe it’s the angle or the sign which is wrong. Next read the program, Gosh! I have not change the degree format of the angle to radius format before I use the built-in Mathematical functions!
Why I am that careless! Do be careful when using angles in your program. Make sure the format of the angle is exactly right!
作者在编程过程中遇到一个难题:无论怎么检查都无法找出导致物体位置错误的原因。最终发现是因为在使用内置数学函数前没有将角度从度转换为弧度。这次经历提醒了他在以后编程中要注意角度单位的一致性。
1682

被折叠的 条评论
为什么被折叠?



