Math with AS (was: Code for a circle)
Math with AS (was: Code for a circle)
- Subject: Math with AS (was: Code for a circle)
- From: Deivy Petrescu <email@hidden>
- Date: Thu, 13 Mar 2003 18:29:10 -0500
On Thursday, Mar 13, 2003, at 15:36 US/Eastern, Helmut Fuchs wrote:
Can anyone explain the formula I should use to generate values for
the position of a window such that the values all fall close to lying
on a 30 pixel diameter circle ?
The formula looks something like this:
x=centerX+radius*sin angle
y=centerY+radius*cos angle
with angle running from 0 to 2*pi
If AppleScript had proper math functions on board, this should be easy
to implement. But it hasn't. I still don't grasp why a scripting
language has to rely on additions to do trigonometric functions (and
even something as basic as rounding a number has to be added by way of
"Standard Additions"). Probably because it wouldn't be AppleScript, if
it was feature complete and devoid of bugs...
HTH,
Helmut
_______________________________________________
Helmut,
This is not so!
If you allow me, I've written a pretty comprehensive set of math
functions. Trigonometric and its inverse, hyperbolic and inverse, log
in any base exponential, change of numerical basis, complex numbers ,
matrices and linear systems, etc. You can download them from my site
below.
Also, Smile has been providing us with a bunch of math functions for a
long long time.
AppleScript has its limitations in dealing with numbers, but it is
possible to do a lot of stuff, as for instance, to create an
application that has use in Plasma Physics (ask Emmanuel, it is called
SmileLab...).
If you want to download the set of libraries get it here:
http://www.dicas.com/MacOs/script_download.html.
However, I am going to improve some of the routines and add others
according to some requests, hopefully between today and tomorrow.
If you want to download Smile or Smile lab, get it from here:
http://www.satimage-software.com/.
One more thing, one does not need these libraries to do the circle,
plain AS will do it!
Regards
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.