引用方法中的方法 [英] Referencing a method within a method

查看:65
本文介绍了引用方法中的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 数学方法,作为许多其他方法的组成部分是常见的。我想找到一种方法在其他方法中调用该方法作为公式的一个组成部分,这可能吗?

I have a  mathematical method which is common as a component of many other methods. I'm looking to find a way to call the method within other methods as a componant of the formula, is this possible?

这是组件,我想参考它在较大的公式中:

This is the componant, and i'm looking to reference it in larger formulae:

public void Area1GW()                                                                   

            {

                {Console.WriteLine("单个山墙的区域为{0}",Math.Round(宽度*高度和高度等级+(Math.Tan(PitchOfRoof *(Math.PI / 180))*宽度/ 2)*宽度/ 2),3);}

            }

public void Area1GW()                                                                   
            {
                {Console.WriteLine("the area of a single gable is {0}",Math.Round(Width*HeightOfSideWall+(Math.Tan(PitchOfRoof*(Math.PI/180))*Width/2)*Width/2),3);}
            }

感谢任何帮助。

推荐答案


实际上,我应该缩短它,这是我想要参考的范围

Actually, i should shorten that, this is the extent of what i'm looking to reference

public void Area1GW()                                                                   

            {

                {Console.Write((Math.Tan(PitchOfRoof *(Math.PI / 180))* Width / 2)* Width / 2),3);}

            }

public void Area1GW()                                                                   
            {
                {Console.Write((Math.Tan(PitchOfRoof*(Math.PI/180))*Width/2)*Width/2),3);}
            }

谢谢





这篇关于引用方法中的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆