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 09-09-2009, 11:37 AM   #1
hhfh
Member
 
Join Date: Jun 2008
Posts: 35
hhfh is on a distinguished road
Default how to draw Ellipse

double dist_rad = radius / m_world.EquatorialRadius;
Angle lat_rad = Angle.FromDegrees(0);
Angle lon_rad = Angle.FromDegrees(0);
double dlon_rad = 0;
double d_alt = alt;
double numDegrees = 0;
numDegrees = 360 / numPoints;
Angle curr = Angle.FromDegrees(0);
for (int i = 0; i < numPoints; i++)
{
curr.Degrees = (double)i * numDegrees;

lat_rad.Radians = Math.Asin(Math.Sin(lat.Radians) * Math.Cos(dist_rad) + Math.Cos(lat.Radians) * Math.Sin(dist_rad) * Math.Cos(curr.Radians));
dlon_rad = Math.Atan2(Math.Sin(curr.Radians) * Math.Sin(dist_rad) * Math.Cos(lat.Radians), Math.Cos(dist_rad) - Math.Sin(lat.Radians) * Math.Sin(lat_rad.Radians));
lon_rad.Radians = ((lon.Radians + dlon_rad + Math.PI) % (2 * Math.PI)) - Math.PI;

//This algorithm is limited to distances such that dlon <pi/2
points[i] = new Point3d(lon_rad.Degrees, lat_rad.Degrees, d_alt);
}

this is draw circle
how to draw Ellipse?
hhfh is offline   Reply With Quote
Reply


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
Ellipse Airspace mertk Development Help 1 04-18-2009 01:17 PM
[Solved] Draw a Sector on the WorldWindowGLJPanel Unregistered Development Help 1 12-15-2008 11:00 PM
Draw Points eenglund Development Help 2 07-03-2008 12:38 AM
how can I draw contour in WW? findsnow Development Help 5 06-05-2008 10:58 PM


All times are GMT +1. The time now is 07:03 PM.


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