Hi,

As mentioned on Direct-L, you can create a Math object from a JS script, (not 
using flash asset??).

with math=getMath()

and a JS script:
function getMath()
{
return Math;
}


It takes about 1780 ms for the script to run, against 2580 for Valentin's 
original script.

Alex, your method is still faster with 1240 ms.

Now my question is: Where does the Math() object come from in the JS version?

Terry


---- Alex da Franca <[EMAIL PROTECTED]> wrote: 
> 
> Am 08.05.2006 um 14:45 schrieb Valentin Schmidt:
> 
> 
> > notice: code not optimized for speed yet
> 
> simply replacing the flash object with a lingo function for asin  
> speeds the thing up by 70%.
> I know, that using flash is slower, than using lingo, but that much ?
> is that one of those mac things ?
> Note, that it is NOT the creation of the flash object, as I tried it  
> with a global flash object, too, which didn't make a difference.
> 
> anyway try this lingo function for asin() instead of using the flash  
> math object.
> 
> on asin ratio
>    if ratio < 1 and ratio > -1 then
>      RETURN atan(ratio/sqrt(1.0 - (ratio * ratio)))
>    else if ratio = 1 then
>      RETURN pi()/2
>    else if ratio = -1 then
>      RETURN -pi()/2
>    end if
> end
> 
> 
> ---------------------------
> 
>    |||
> a¿ex
> 
> 
> 
> [To remove yourself from this list, or to change to digest mode, go to 
> http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
> [email protected]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
> learning and helping with programming Lingo.  Thanks!]


[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[email protected]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]

Reply via email to