Answer the question
In order to leave comments, you need to log in
C# Math Am I doing it right?
Write a procedure for performing function calculations:
The output is always wrong, what am I doing wrong?
double x = 0.96;
double y = Math.Cos(1.5 * x) - Math.Pow(Math.E, Math.Sin(x + (5.0 / 3.0))) + Math.Sqrt(x + (7.0 / 6.0));
Console.WriteLine(" x = {0} \t y = {1} ", x, y);
Console.ReadKey();
Answer the question
In order to leave comments, you need to log in
Yes, everything seems to be correct. Most likely a typo somewhere. It happens. Or somewhere it may be said that the angles should be in degrees and not radians. Then the expression under the sine / cosinos must be multiplied by 180 / pi.
Instead
, use Math.ExpMath.Pow(Math.E, Math.Sin(x + (5.0 / 3.0)))
Math.Exp( Math.Sin(x + (5.0 / 3.0)))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question