将Matlab Math Trig转换为C# [英] Convert Matlab Math Trig into C#
本文介绍了将Matlab Math Trig转换为C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将下面的MATLAB代码转换为下面的c#代码。我需要一些帮助
How to convert MATLAB code below into c# code below. I need some assistance
theta = 0:pi / 180:2 * pi;
theta=0:pi/180:2*pi;
costheta = cos(theta);
costheta=cos(theta);
pianoboyCoder
pianoboyCoder
推荐答案
嗨pianoboyCoder,
Hi pianoboyCoder,
如果你添加评论来描述以下代码,解决问题将是有益的。
It will be beneficial to resolve the issue if you add comment to describe the following code.
theta=0:pi/180:2*pi;
此外,您可以参考
Math 方法,它提供了三角函数的常量和静态方法,对数和其他常见的数学函数。例如。
In addition, you could refer to Math method in .net framework, which provides constants and static methods for trigonometric, logarithmic, and other common mathematical functions. Such as.
// PI
var pi = Math.PI;
//Cos
var costheta = Math.Cos(pi);
祝你好运,
张龙
这篇关于将Matlab Math Trig转换为C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文