 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Jim Davis Guest
|
Posted: Tue Apr 10, 2007 8:10 am Post subject: Earth sunrise math ? |
|
|
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
|
|
| Back to top |
|
 |
Jim Davis Guest
|
Posted: Thu Apr 12, 2007 8:10 am Post subject: Re: Earth sunrise math ? |
|
|
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
|
Posted: Sat Apr 14, 2007 8:09 am Post subject: Re: Earth sunrise math ? |
|
|
| 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
|
Posted: Sat May 12, 2007 6:29 am Post subject: Re: Earth sunrise math 3 Space Geometry |
|
|
// 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 |
|
 |
|
|
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
|
|