• 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: "David B. Gustavson" <email@hidden>
  • Date: Tue, 9 May 2006 14:04:11 -0700

You have a spurious parenthesis before "cos(-HA)", which causes the following sum to be multiplied by the first two cos's, which is inconsistent with your x arithmetic below.
There are two more unnecessary parentheses, ahead of the two sin's, but they don't cause problems.
Dave
Hi all,

Can someone please explain this to me...... I have the expression in one statement and it gives the wrong answer. After breaking it up I get the answer is correct answer

Thoughts?

Thanks,

Dale

set HA to 256.84 * 3.1415926535 / 180 --in radians
set Dec to 29.82 * 3.1415926535 / 180 --in radians
set latitude to 42.55574 * 3.1415926535 / 180 --latitude location in radians.

set Dz to cos (latitude - pi / 2) * (cos (Dec) * (cos (-HA) + (sin (latitude - pi / 2) * (sin (Dec)))))

display dialog "Dz " & Dz

set x1 to cos (latitude - pi / 2)
set x2 to cos (Dec)
set x3 to cos (-HA)
set x4 to x1 * x2 * x3
set x5 to sin (latitude - pi / 2)
set x6 to sin (Dec)
set x7 to x5 * x6
set x8 to x4 + x7

display dialog "C " & x8
_______________________________________________
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


--
--David B. Gustavson, tel:650/961-0305 fax:208/475-7525
1946 Fallen Leaf Lane, Los Altos, CA 94024-7206 email@hidden
_______________________________________________
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


References: 
 >Math expression help (From: Dale J Martin <email@hidden>)

  • Prev by Date: Re: Math expression help
  • 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