World Wind Forums

Go Back   World Wind Forums > WorldWind .Net Development > Developers' Corner

Developers' Corner General World Wind development.

Reply
 
Thread Tools Display Modes
Old 12-01-2011, 06:25 PM   #11
nlneilson
Super Moderator
 
Join Date: Nov 2006
Location: Mojave & Oxnard California
Posts: 2,622
nlneilson is on a distinguished road
Default

Are you doing your calculations using a sphere or are you compensating for the ellipsoidal shape of the earth?
__________________
Neil
http://www.nlneilson.com
nlneilson is offline   Reply With Quote
Old 12-01-2011, 06:48 PM   #12
QCoder
Junior Member
 
Join Date: Jul 2011
Location: Massachusetts
Posts: 3
QCoder is on a distinguished road
Smile On a sphere ...

Quote:
Originally Posted by nlneilson View Post
Are you doing your calculations using a sphere or are you compensating for the ellipsoidal shape of the earth?
These are for a sphere.

The thing about L'Huiller's that started us on this path is that if you take a complicated shape like the tree shape described, on a small scale, and move that fixed shape about a spherical Earth, recalculating the area, L'Huiller's will give you a different answer. For example, if it's placed up at about 45N, it does okay. Move it to the Equator, and it gives a different answer.

We of course very carefully checked that our rotation of the points was correct. The rotation is done by first calculating unit vector positions for all the points in the tree shape, applying the same rotation matrix to them (done in R using the standard long precision), carefully renormalizing before and after. Moreover, the other algorithms, like a unit vector area algorithm we have, and the NASA JPL one, do give the same area for the tree at the Equator as they give up at 45N, and they agree with each other.

Alas, these algorithms also fail on the clever test case which the people at Mathworks cooked up for their areaint function in MATLAB. So, workin' on this ....

If there's interest, I can take on publishing a code for doing this here, in ANSI C, but I have a commitment to first do this and deliver it for within B. This is almost entirely on my own time, so I can't promise a schedule.

The Green's theorem technique I'm looking at would generalize to WGS-84, although that's not what I'm aiming for right now, and whatever code I might offer will only work for a sphere. Also, the radius of said sphere will be a parameter (since there are several ones used for spherical approximations of Earth), although it will default to something sensible.

Thanks for your question.
QCoder is offline   Reply With Quote
Old 12-01-2011, 07:49 PM   #13
nlneilson
Super Moderator
 
Join Date: Nov 2006
Location: Mojave & Oxnard California
Posts: 2,622
nlneilson is on a distinguished road
Default

I am mostly concerned with geodesic distance and angles.
Have been using the Vincenty Formula/s using C++.
Was recently informed of the accuracy limitations by a mathematician who has done formulas at greater accuracy, more than I need.

I like to tinker with numbers.
__________________
Neil
http://www.nlneilson.com
nlneilson is offline   Reply With Quote
Old 02-13-2012, 02:01 AM   #14
danzig70
Member
 
Join Date: Mar 2009
Posts: 56
danzig70 is on a distinguished road
Default




I have made a c++ program to make icon and line/polygon feature layer.xml files. I have been using the haversine formula to calculate the distances around a point as above, distance between two points, bearing between two points, position along a route, etc. It is quite useful! I also used trig functions for the altitude and radius.

Last edited by danzig70; 02-13-2012 at 02:08 AM.
danzig70 is offline   Reply With Quote
Reply

Tags
spherical polygon


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may post new threads
You may 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

Similar Threads
Thread Thread Starter Forum Replies Last Post
WWJ SDK Alpha 4.1 - 0.4.1 available tag WWJ Release Announcements 56 11-14-2009 12:51 PM
How to calculate area of an irregular polygon by 3D coordinates? Jason_Steven Developers' Corner 9 11-13-2008 07:11 AM
add Urban Area mode as an icon on the toolbar! Phil T Add-ons & Scripts 10 02-25-2005 04:48 PM


All times are GMT +1. The time now is 01:21 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.