毕达哥拉斯定理的制定公式 [英] Trouble making formula for pythagorean theorem
本文介绍了毕达哥拉斯定理的制定公式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我的第一个课程,我需要一些帮助。我差不多完成了这个,但我不知道从哪里开始。我指定的方面有问题。任何提示?
This is my 1st program and I need some help. I''ve almost got this one finished but I don''t know where to go from here. There is something wrong with the sides I''ve assigned. Any tips?
展开 | 选择 | Wrap | 行号
推荐答案
//计算斜边;
side1 =((m * m) - (n * n));
side2 =(2 * m * n);
斜边= sqrt((side1 * side1)+(side2 * side2));
}
// compute hypotenuse;
side1=((m*m)-(n*n));
side2=(2*m*n);
hypotenuse = sqrt((side1*side1)+(side2*side2));
}
这看起来有点像你已经越过了毕达哥拉斯定理的余弦定律。 m和n是你想要平方和加法的值,然后是平方根。
这假设你的三角形是这样的:
This looks sort of like you''ve crossed the Law of Cosines with the Pythagorean Theorem. m and n are the values you want to square and add, then square root.
This assumes your triangle is like this:
展开 | 选择 | Wrap | 行号
所以我一直让低音等于40 ?????我无法理解。这是我现在的代码。 (只是试试这个)
so i keep getting the hypo to equal 40????? I can''t figure it out. here''s my code now. (just trying this one out)
展开 | 选择 | Wrap | 行号
对不起,我已经经历了很多,但我是关于放弃。请有人给我一些希望,c ++耗尽了我所有的法术力。
Sorry I''ve gone through it a lot but I''m about to give up. Please someone give me some hope, c++ has drained all my mana.
展开 | 选择 | Wrap | 行号
这篇关于毕达哥拉斯定理的制定公式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文