Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-02-2006, 10:40 AM   PM User | #1
marceltinka
New to the CF scene

 
Join Date: Jul 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
marceltinka is an unknown quantity at this point
Question Help Wanted Math Problems

I do not know how to use javascript math.
Is there a good explanation where complicated formulas are being discussed.

K3 = [k0sin^41" (nu) sin(lat)cos^3(lat)/24][(5 - tan^2(lat) + 9e'^2cos^2(lat) + 4e'^4cos4(lat)]
where:
sin1" = pi/(180*60*60)
e = SQRT(1-b2/a2)
e'2 = (ea/b)2 = e2/(1-e2)
nu = a/(1-e2sin2(lat))1/2

^2 means x² and ^3 x³ and so on...
lat, k0, nu, e' are variables...

My tries causes wrong results.

The line is an example of some lines I need.
(attached files show topic and all formulas)

May someone can help me?

Thanks

Marcel
Attached Files
File Type: zip allFormulas.zip (10.9 KB, 103 views)
marceltinka is offline   Reply With Quote
Old 07-02-2006, 10:47 PM   PM User | #2
joeframbach
Regular Coder

 
Join Date: Dec 2002
Location: a bit west of pittsburgh
Posts: 236
Thanks: 1
Thanked 0 Times in 0 Posts
joeframbach is an unknown quantity at this point
i am confused over this.
sin(1") = pi/(180*60*60).
shouldn't it be 1"=pi/(180*60*60)?
either way, it is so close to 0 that sin(1") approximates 1", or 4.8481368 x 10^-6, or 0.0000048481368, so we'll just use that.

Also, be very verbose when using * for multiplication and ^ for powers.
try:
Code:
K3 = [k0 * sin(1")^4 * (nu) * sin(lat) * cos(lat)^3 /24] [ 5 - tan(lat)^2 + 9 * e'^2 * cos(lat)^2 + 4 * e'^4 * cos(lat)^4]
where:
sin1" = pi/(180*60*60)
e = SQRT(1-b^2/a^2)
e'2 = (e*a/b)^2 = e^2/(1-e^2)
nu = a/(1-e^2 * sin(lat)^2) ^ (1/2)
to explain the problem. Otherwise it is very hard to decipher without really looking into the documentation provided.

Now to the solution:
Code:
var sin_one_minute = 0.0000048481368;
var e = Math.sqrt(1-b*b/a*a);
var e_prime_2 = Math.pow((e*a/b),2);
var nu = a / Math.sqrt(1 - e*e * Math.pow(Math.sin(lat),2));
K3 = (k0 * Math.pow(sin_one_minute,4) * nu * Math.sin(lat) * Math.pow(Math.cos(lat),3) / 24) * (5 - Math.pow(Math.tan(lat),2) + 9 * e_prime_2 * Math.pow(Math.cos(lat),2) + 4 * Math.pow(e_prime_2,2) * Math.pow(Math.cos(lat),4));
Note: I don't even know if this works. I just threw it together. All the necessary Math functions, Math.pow, Math.sqrt, Math.sin, Math.cos, Math.tan, are all you should need. Just note that they use radian measure and not degree measure.
joeframbach is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:13 AM.


Advertisement
Log in to turn off these ads.