sin(), cos() etc... how can it be done with C/AL

Hi all! I have to do some calculations with NF (I’m using NF 2.60, the german version) and I need functions like sin(), cos(), tan(), sqrt() etc… In C/AL I couldn’t find them. Does anyboby know some workaround or an .ocx-file that I can use? Thanks AM

For the sin(), cos() and tan() functions you need an ocx, but sqrt() can be done with the power() function. Sqrt(x) can be calculated as power(x,0.5). Dennis van Es QwinSoft bv The Netherlands Edited by - Dennis on 11/14/00 9:04:02 AM

oh yes, I didn’t think about ‘power()’. THNX Dennis, for the reminder. nontheless: do you know a link or a source, where I can get such an ocx? I’m already grabbing for the Vis. C++ CD… :wink:

Hi If you can’t find a OCX returning the cos or sin, I should be fairly simple to make such a component. I could make one for you(for free), if you would like me to. Just drop me note on which functions you need, and I’ll make one within a couple of days. Regards Andreas Lundin

Wow! That would be super, Andreas. I just worked through my formulas and the only functions that I still need are sin(), cos() and tan(). If it doesn’t stop you too long from making your own work, I would like to accept your offer. Perhaps one day I can help you with a problem, too. My e-mail address is: a.mueller@knk-la.com best regards Adrian

There’s a company in Austria which developed such an OCX for Navision. Look at http://www.softsys.at/ocx.html Marcus Marcus Fabian phone: +41 79 4397872 m.fabian@thenet.ch

Hi again I’ll start making the ocx right away. The first release will include sin(), cos() and tan(). As a comment to fabian: Yes, it seems like their ocx could do the trick, but it’s a commercial product, isn’t it? I’ll make my code available for free at www.mynavision.net, when I have finished it. Regards Andreas

I have a small ocx in my “toolbox”. Maybe you can use this. Give it a decimal as input and it will return the result as a decimal too. Handles these functions: SIN, COS, TAN (in Degrees and Radians)and SQRT Download it from http://ocx.skilon.com (hmm, seems to have some problem with my webforwarding!) USE THIS LINK: http://soren.nielsen.dk/ocx until resolved. /Soren Edited by - SNielsen on 11/15/00 12:30:13 PM

Hi again I have just downloaded your ocx, and it seems to be similar to what I had in mind. So I’ll halt my own ocx for now. Just a comment on the link. It doesn’t work, but I succeeded when using http://soren.nielsen.dk/ocx/ instead. So, Adrian try it out, it worked for me. If you still need something, I’ll fire up my own ocx. Thanks a lot SNielsen. Regards Andreas

If anyone is interested i could write a tutorial on how to create an ocx control for use in Navision Financials. Anyone? /Soren

Soren: please do so !

Soren, please do. The general idea is clear, but it are the details that count. And when you have found the ways of using or avoiding the Navision typicalities already, your “how-to” guide would be most welcome. John

Heureka! Soren, your ocx works perfectly. Thanks a lot! Adi

Hi Adrian, Sorry for being damn curious but I can’t help it :wink: For what purposes do you need those trigonomety functions within Navision ? On what sort of module are you working on ? Drop Inventory ? Or the ultimate shoot them up game for Navision Financials ;-D I’m just asking coz last time I used sin() was to create a lookup table of sin values which made funky sprites movements for a little game I was working on a loooooooooong time ago. tarek_demiati@ureach.com

Hi Tarek! My current work involves a module called manufacturing/REB. I have some (german) specifications here, called REB23.003. These contain a set of formulas which are used for calculating e.g. the amount of concrete you need for a building’s fundament. Or how much earth you get/need when digging a canal or making a ramp for a dam. Sorry Tarek, no game development here. While being still a newbie I have to learn the “basics” first. But the idea… hmmm… BTW: What game were you working at? Which programming language did you use? And finally: Is there a (more or less :wink: ) functioning pre-alpha-version of it I can look at? Regards Adrian