Hello
I tried to build an application (in the C# console application) that show me the cut function (I don't know how you say it in english, I mean that if I have function f(x)=2x^2, than f'(x)=4x)
I failed in doing it because I can't think how to do it with parameters
So my question is:
C# has parameters for mathemtical functions?
And if it's true, how to use it?
Loading
VulpesPosted Feb 18, 2012, 6:58 AM
http://msdn.microsoft.com/en-us/library/system.math.aspx
and there's also the BigInteger and Complex types in the System.Numerics namespace:
http://msdn.microsoft.com/en-us/library/system.numerics.aspx
Other than that you're more or less on your own though there are some third party libraries available if you google for them.
What I've done above should be able to differentiate any polynomial so I'd just use that and use a similar approach to integrate it.
yuval simonPosted Feb 17, 2012, 1:49 PM
Its must had been in proccess for years !
When can I learn C# commands?
I learned at school only variables, condition (if), loops(while and for), switch and arrays
I tried two weeks ago to write code that differentiates the function, but I've tried to do it on all kinds of functions I know (I've entered the code with switch, the user first write the function's type so it be easier to write the continuation code) and I've started writing the polinom differentiate code and I stucked
Now when I think of it, the real problem is to diminish the denominator and the numerator
How can you do it?
VulpesPosted Feb 17, 2012, 11:07 AM
However, I've changed the Main method so that it now asks the user to enter the arguments, separated by spaces, and also asks for the value of 'x'.
The program differentiates (or 'cuts' as you call it) any polynomial passed to it.
It would not be difficult to add methods to integrate the polynomial and to evaluate the integral between two limits. You could also add a method to calculate maxima and minima provided the degree of the polynomial was not more than 3 though you might need the assistance of my article on solving quadratic equations using C# to find the stationary points of a third degree polynomial.
http://www.c-sharpcorner.com/uploadfile/b942f9/using-the-complex-type-to-solve-quadratic-equations/
However, you would of course need additional methods to deal with trigonometric functions, transcendental functions, functions involving two or more variables etc. You'd also need a way of distinguishing between the various types of function that the user might input.
So to do all this would involve a considerable amount of work and I wouldn't expect to finish any time soon.
yuval simonPosted Feb 17, 2012, 8:25 AM
I really dont know what are those commands (I learn C# at high school) but I tried copy it to Visual Studio and it didn't work (It wrote "There must be at least one argument")
I'm sure it work, maybe there's a missing line but I have to check all the commands and I don't if it's what I asked
The program is getting numbers from the user and put it into formula? (From what you wrote I understand that it it cuts function of ax^3+bx^2+cx^3+d, is it true?)
I want it to cut all kinds of functions (Such as x^0.5 (squart), f(x)/g(x), f(x)*g(x), [f(x)]^n)
Do you know the application Wolframalpha?
I want to make a program which does the same but only write the function's cut and the integral (not graphs) and also that it find the maxima and minima points
Is it hard to build such program?
VulpesPosted Feb 16, 2012, 6:41 PM
or, if you wanted to differentiate x^3 - 3x + 4, you'd type in: