[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdeedu/kstars/kstars
From:       Pablo de Vicente <p.devicente () wanadoo ! es>
Date:       2005-03-20 14:30:08
Message-ID: 20050320143008.5C3B216F7D () office ! kde ! org
[Download RAW message or body]

CVS commit by pvicente: 

VLSR calculator module

Added a function TopocentricVelocity() which returns, in the parameter list, an array \
with thevelocity of a point on the surface of the Earth in km/s, for a given date and \
time. This value may be used for computing the radial velocity of a source referred \
to a local point on the surface of the Earth once the LSR velocity of that source is \
known. The X and Y axis are contained in the equator and the X axis is towards the \
nodes line. The Z axis is along the poles.

CCMAIL: kstars-devel@kde.org


  M +20 -1     geolocation.cpp   1.13
  M +20 -6     geolocation.h   1.18


--- kdeedu/kstars/kstars/geolocation.cpp  #1.12:1.13
@@ -3,6 +3,8 @@
                              -------------------
     begin                : Sun Feb 11 2001
-    copyright            : (C) 2001 by Jason Harris
+    copyright            : (C) 2001-2005 by Jason Harris
     email                : jharris@30doradus.org
+    copyright            : (C) 2003-2005 by Pablo de Vicente
+    email                : p.devicente@wanadoo.es
  ***************************************************************************/
 
@@ -180,2 +182,19 @@ void GeoLocation::geodToCart (void) {
         PosCartZ = (xn*(1-e2)+Height)*sinLat;
 }
+
+void GeoLocation::TopocentricVelocity(double vtopo[], dms gst) {
+        
+        double Wearth = 7.29211510e-5;     // rads/s
+        dms angularVEarth;
+        
+        dms time= GSTtoLST(gst);
+        angularVEarth.setRadians(time.Hours()*Wearth*3600.);
+        double se, ce;
+        angularVEarth.SinCos(se,ce);
+
+        double d0 = sqrt(PosCartX*PosCartX+PosCartY*PosCartY);
+        // km/s
+        vtopo[0] = d0 * Wearth * se /1000.;
+        vtopo[1] = d0 * Wearth * ce /1000.;
+        vtopo[2] = 0.;
+}

--- kdeedu/kstars/kstars/geolocation.h  #1.17:1.18
@@ -3,6 +3,8 @@
                              -------------------
     begin                : Sun Feb 11 2001
-    copyright            : (C) 2001 by Jason Harris
+    copyright            : (C) 2001-2005 by Jason Harris
     email                : jharris@30doradus.org
+    copyright            : (C) 2003-2005 by Pablo de Vicente
+    email                : p.devicente@wanadoo.es
  ***************************************************************************/
 
@@ -102,5 +104,5 @@ public: 
         */
         const dms* lat() const { return &Latitude; }
-/**@return elevation above seal level
+/**@return elevation above seal level (meters)
         */
         double height() const { return Height; }
@@ -187,5 +189,5 @@ public: 
 
 /**Set elevation above sea level
-        *@param hg the new elevation
+        *@param hg the new elevation (meters)
         */
         void setHeight( double hg ) { 
@@ -195,5 +197,5 @@ public: 
 
 /**Set X 
-        *@param x the new x-position
+        *@param x the new x-position (meters)
         */
         void setXPos( double x ) { 
@@ -202,5 +204,5 @@ public: 
         }
 /**Set Y 
-        *@param y the new y-position
+        *@param y the new y-position (meters)
         */
         void setYPos( double y ) { 
@@ -209,5 +211,5 @@ public: 
         }
 /**Set Z 
-        *@param z the new z-position
+        *@param z the new z-position (meters)
         */
         void setZPos( double z ) { 
@@ -297,4 +299,16 @@ public: 
         KStarsDateTime LTtoUT( const KStarsDateTime &lt ) const { return lt.addSecs( \
int( -3600.*TZ() ) ); }  
+
+        /* Computes the velocity in km/s of an observer on the surface of the Earth 
+         * referred to a system whose origin is the center of the Earth. The X and 
+         * Y axis are contained in the equator and the X axis is towards the nodes
+         * line. The Z axis is along the poles.
+         *
+         * @param vtopo[] Topocentric velocity. The resultant velocity is available 
+         *        in this array.
+         * @param gt. Greenwich sideral time for which we want to compute the \
topocentric velocity. +         */
+        void TopocentricVelocity(double vtopo[], dms gt);
+
 private:
         dms Longitude, Latitude;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic