r.van.der.velden
(Fresh Scripter)
2003-04-04 02:42 PM
Sin Cos Tan

Are there any Sin, Cos, Tan functions available for kix?

JochenAdministrator
(KiX Supporter)
2003-04-04 02:52 PM
Re: Sin Cos Tan

AFAIK, no !

Tell me what one could need these for and I may write those [Wink]


r.van.der.velden
(Fresh Scripter)
2003-04-04 03:14 PM
Re: Sin Cos Tan

Well... Basic Mathematic function.. there a lots and lots of ways to use them.

JochenAdministrator
(KiX Supporter)
2003-04-04 03:16 PM
Re: Sin Cos Tan

... I know that for sure as my educational background is electronics

Oh well, just wait and see If I got the time [Roll Eyes]


Ghost
(Starting to like KiXtart)
2003-04-04 03:19 PM
Re: Sin Cos Tan

What are you trying to do with Cos, Tan, Etc?

[Smile]


Kdyer
(KiX Supporter)
2003-04-04 03:20 PM
Re: Sin Cos Tan

Can you provide a specific example?

Why would you need this in a login script?

Now, if you are developing a KiXForms calculator, that would be a different story. [Smile]

I believe there was one done for SQRT..

Kent


Sealeopard
(KiX Master)
2003-04-04 04:46 PM
Re: Sin Cos Tan

See for example Eric Weisstein's World of Mathematics under http://mathworld.wolfram.com/Sine.html , which contains approximation formulas for SIN().

ShawnAdministrator
(KiX Supporter)
2003-04-04 04:50 PM
Re: Sin Cos Tan

Think I know where R. is coming from. These functions have much use in certain classes of windows (forms) applications. Especially the kind that employ drawing ... I could have used these myself a while ago, I think Jooel ended-up writting a table driven version of the functions but they aren't very accurate.

-Shawn


JochenAdministrator
(KiX Supporter)
2003-04-04 10:19 PM
Re: Sin Cos Tan

ermmmm ....

I took some time and already gave up on the first function sin() ... near to impossible (for me at least) using kix intrinsic methods [Frown]

All what I got so far is the knowledge that the nearest approach for e within KiXtart would be 2.71828182845905 (which is not precise enough I think)

Another rather crude thing I created within this short excursion to the world of ars mathematica is my attempt to code a pwr() func which allows one to calc x^y (OF COURSE y only allows integers !)



function pwr($x,$y)
    dim $i
    $pwr = cdbl($x)
    for $i = 2 to $y
        $pwr = $pwr * $x
    next
endfunction



should be better intrinsic [Roll Eyes]

Well, I also gave up to only understand what the heck an imaginary number is ... only so much : my scientific Casio Calculator gave up calculating Square Root of -1 [Eek!]

On the other side I would really like to see those very basic mathemtical function in KiX [Big Grin]

l8r


RearView
(Lurker)
2003-10-14 09:05 PM
Re: Sin Cos Tan

Hey Guys!
I just began looking for this very thing. Here is the Application that someone above ask for... I am currently writing a KiXforms Program to Calculate the Heel Height of a Truss. This requires the use of Cos and Sqr. I realize that this program is much more than a logon script ... but Kix's flexability is part of what makes it a great tool. - Shane


Sealeopard
(KiX Master)
2003-10-14 09:17 PM
Re: Sin Cos Tan

As I already posted above, you can either use approximation formulas, use a lookup table with pre-calculated values, or write your own custom COM-DLL that provides math functions.

macIntozAdministrator
(Administrator)
2003-10-14 10:42 PM
Re: Sin Cos Tan

shawn, you wrong.
jooel wrote his own functions to calculate...
afaik, this is inside coord() udf.
no tables, pure approximation with floating numbers and all.


Bryce
(KiX Supporter)
2003-10-15 05:24 AM
Re: Sin Cos Tan

well...

SQRT() A square root function

SQR() A Square and or raise to the power of X function

hmm... sounds like a good research/project to do [Big Grin]

[ 15. October 2003, 05:25: Message edited by: Bryce ]