• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Math expression help
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Math expression help


  • Subject: Re: Math expression help
  • From: Luther Fuller <email@hidden>
  • Date: Tue, 9 May 2006 18:33:42 -0500

Okay let's try something simple.....

set HA to 256.84 * 3.1415926535 / 180 --in radians
set Dec to 29.82 * 3.1415926535 / 180 --in radians

set x to cos HA * (cos Dec)

display dialog "x " & x

set x1 to cos (HA)
set x2 to cos (Dec)
set done to x1 * x2

set x to x1 * x2

display dialog "x " & x


As you can see very different results........ what is going on here..... what am I missing! Besides the editor really likes to throw in parenthesis when I compile the script!

Taking off my AppleScripter's hat and putting on my mathematician's hat (I have one), I notice that neither I nor the editor know what you mean by


	set x to cos HA * (cos Dec)

The editor thinks you mean

	set x to cos (HA * (cos Dec))

but the rest of your code indicates that you really want

	set x to (cos HA) * (cos Dec)

My advice, both as an AppleScripter and a mathematician is ... If in doubt, use lots & lots of parenthesis!

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Math expression help
      • From: kai <email@hidden>
References: 
 >Math expression help (From: Dale J Martin <email@hidden>)
 >Re: Math expression help (From: deivy petrescu <email@hidden>)
 >Re: Math expression help (From: Dale J Martin <email@hidden>)

  • Prev by Date: Re: Character Encoding in plain text
  • Next by Date: Re: Math expression help
  • Previous by thread: Re: Math expression help
  • Next by thread: Re: Math expression help
  • Index(es):
    • Date
    • Thread