BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Earth sunrise math ?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Graphics)
View previous topic :: View next topic  
Author Message
Jim Davis
Guest





PostPosted: Tue Apr 10, 2007 8:10 am    Post subject: Earth sunrise math ? Reply with quote



Need math for sunrise/sunset curve on earth map :

Given a rectangular projected earth section map
(Top&Bottom are Latitudes , Left&Right are Longitudes) .

What is math for sunrise/sunset curve thru rectangular map ?

Say for some map_Y , what is map_X of the "sunline" ?

Cheers , Jim D
Back to top
Roger
Guest





PostPosted: Thu Apr 12, 2007 4:52 am    Post subject: Re: Earth sunrise math ? Reply with quote



http://williams.best.vwh.net/sunrise_sunset_algorithm.htm

may help,
Roger
Back to top
Jim Davis
Guest





PostPosted: Thu Apr 12, 2007 8:10 am    Post subject: Re: Earth sunrise math ? Reply with quote



Roger <aretae (AT) magma (DOT) ca> wrote in news:461d74b5 (AT) newsgroups (DOT) borland.com:

Quote:
http://williams.best.vwh.net/sunrise_sunset_algorithm.htm

earth rotation 24 hours
earth axis tilt 23.45 degrees
orbit period 365.25 days
elliptical orbit ignore maybe
non spherical earth ignore for sure

Given [TDateTime] , calc earth lat & long of sun zenith point ,
defining sunlite boundary - great circle .

Given single earth [latitude] - small circle ,
maybe 2 intersections with above sunline great circle ,
calc 2 longitudes (sunrise & sunset) .

Rectangular earth map file name includes map boundaries ,
first 3 digits integer degrees ,
like "San Bernadino.W120N034W11788N03288.BMP" .

Have graphics map darkening code ,
approximatting curved twilight band with several trapizoids .

Still need above spherical math .
Back to top
Jim Davis
Guest





PostPosted: Sat Apr 14, 2007 8:09 am    Post subject: Re: Earth sunrise math ? Reply with quote

Quote:
Rectangular earth map file name includes map boundaries ,
first 3 digits integer degrees ,
like "San Bernadino.W120N034W11788N03288.BMP" .


struct { double Lat , double Lon } PointJ ; // earth point radians

TabName : NamePoint NameType NameString
NameTypeEnum { Country, State, City, Mountain, Water } ;

TabPntLists : Pnts[] PntsLen PntsType PntsColor
PntsTypeEnum {RoadRiver, Ocean, Continent country state desert forest lake} ;
RoadRiver has PntsLen-1 lines
Show RoadRiver if (HeightCalc(Pnts) < RoadRiverFraction * CanvasHeight)
if(~RoadRiver) close area w/ line (Pnts[PntsLen-1], Pnts[0])
?? area fill paints all points on area edge
?? TabAltitude : AltPoint Altitude

? sun longitude is linear function of TDateTime , independant of sun latitude
? lat 0 equator or northpole
? lon positive west of greenwich
? great circle on rectangle is somekinda ellipse
? pictures from space projection

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// http://geospatialmethods.org/spheres/GCIntersect.html
// bottom of page : Great Circle intersects Latitude
// ?? detect - return false if no intersection greatcircle with latitude
//-----------------------------------------------------------------------------
bool TwoLonEdge (
double& SunRisLon , // output sun rise longitude < pi west(+??) of sun
double& SunSetLon , // output sun set longitude < pi east(-??) of sun
PointJ Sun , // input sun lat & lon
double MapLat ) // input latitude in map

{ double r,z,a,b,c,j,d,e,h,y0,y1,x0,x1 ;
r = 1 ; // ??
z = r * sin(MapLat) ;
a = 2 ; // ?? Sun.Lat Sun.Lon
b = 3 ;
c = 4 ;
j = c * z ;
d = (b*j) / (b*b + a*a) ;
h = (r*r - z*z - ((j*j)/(a*a))) * ((a*a)/(b*b + a*a)) ;
e = sqrt(h + d*d) ;
// ?? if( ) return false ;
y0 = -d - e ;
y1 = -d + e ;
x0 = (-b * y0 - j) / a ;
x1 = (-b * y1 - j) / a ;
SunSetLon = atan2(y1,x1) ; // -pi ... +pi
SunRisLon = atan2(y0,x0) ;
// ?? ris=0 set=1 ?? or must distinguish now
return true ;
}
Back to top
Jim Davis
Guest





PostPosted: Sat May 12, 2007 6:29 am    Post subject: Re: Earth sunrise math 3 Space Geometry Reply with quote

// http://www.geom.uiuc.edu/docs/reference/CRC-formulas/
// 9.4 Relations between ... 3-Space Coordinates

Translating above webpage to C++ .
// latitude 0 at northpole
// longitude is positive east of greenwich
// camera in space is "projective transformation"

Where is C source for 3 Space Geometry ?
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Graphics) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.