Dear experts! Tell me please. I need to use the arcsin function in delphi (creating Win32 applications), but for this I need the math module, which I don’t have. I saw on one of the forums that you can use the library from Windows with mathematical formulas, but for some reason the method proposed there does not work. Tell me how this can be done or there is another solution to the problem. Thanks in advance to all the answers. Sincerely, Marat.
|
2 answers
In general, one-time can do with this:
function ArcSin(const X : Single) : Single; asm fld1 fld X fst st(2) fmul st(0), st(0) fsubp fsqrt fpatan end; |
Why write the whole math library if you only need arcsine? Suffice it to recall the school course of mathematics (or see here )
fuction arcsin( const Number : Extended ) : Extended; begin result := arctan(Number/(sqrt(1-sqr(Number)))); end; And all business. And you can spy here .
- Get involved in the math algorithm ??? And also, specify which quarters of the conversation? What signs? Maybe you should still read at least basic formulas on Wikipedia? - KoVadim
- I meant a quarter of the sin and tg functions, I deleted the comment because I found a huge error in it, and not only in it but in all my algorithm. Thank you for bringing me to this idea !!! - Marat Usmanov
- Fuh carried in the algorithm there is no error. And trigonometry must be remembered, with this I agree with you. - Marat Usmanov
|
uses Math, it does not compile? - Nofate ♦mathmodule is not. - Marat Usmanov