<p>Firstly, there is no star's sidereal time. <br>Sidereal time is dependent on the current date and time. It equals the star's right ascension plus its hour angle ... which is almost the formula you provided, since the hour angle is <span class="math-container">$acos(-tg({\delta})tg({\phi}))$</span> only when the star's altitude is zero (also, the minus should be a plus).<br> Considering the right ascension added to the hour angle is constant for all points on the celestial sphere (since they are measured in the opposite direction, this sum will be the hour angle of the <span class="math-container">${\gamma}$</span>point),  this formula is valid for all points, including the Sun.</p>

CC BY-SA 4.0
2019-10-12T19:17:24.323Z
The code part was not there when I answered this ...
Tosic
CC BY-SA 4.0
2019-10-12T14:05:47.377Z
2019-10-12T14:05:47.377Z
Tosic
<p>There is formula for stars sideral time: 
<span class="math-container">$$ra - \arccos(-\tan(dec)*\tan(lat)).$$</span></p>

<p>where <span class="math-container">$ra$</span> - is right of ascension at the vernal equinox.</p>

<p><span class="math-container">$lat$</span> = latitude</p>

<p><span class="math-container">$dec$</span> = declination</p>

<p>Is it applicable for the sun with 0 <span class="math-container">$ra$</span> and 0 <span class="math-container">$decl$</span>? If not, why not?</p>

<p>I want to use <a href="https://astronomy.stackexchange.com/questions/14492/need-simple-equation-for-rise-transit-and-set-time">Need Simple equation for Rise, Transit, and Set time</a> to get setting time and rising time of a star to code. </p>

<pre><code>for(int m=1;m&lt;100;m++){
ts =2*M_PI*m+ (ra - acos(-tan(dec)*tan(lat))); // angle on each day iterating m
d=(ts-4.894961212735792 - longitude)/(6.30038809898489);
printf("%f since midnight", (d-0.5)/24); // d - 0.5 to handle midnight
}
</code></pre>

<ol>
<li>I am not sure if my iteration is ok</li>
<li>d - 0.5 </li>
</ol>

<positional-astronomy>
ra for sun vs stars
user3026756
# ra for sun vs stars

(Asked by: username_0 on 2019-10-12)

There is formula for stars sideral time: 
$$ra - \arccos(-\tan(dec)*\tan(lat)).$$
where $ra$ - is right of ascension at the vernal equinox.
$lat$ = latitude
$dec$ = declination
Is it applicable for the sun with 0 $ra$ and 0 $decl$? If not, why not?
I want to use Need Simple equation for Rise, Transit, and Set time to get setting time and rising time of a star to code. 
for(int m=1;m<100;m++){
ts =2*M_PI*m+ (ra - acos(-tan(dec)*tan(lat))); // angle on each day iterating m
d=(ts-4.894961212735792 - longitude)/(6.30038809898489);
printf("%f since midnight", (d-0.5)/24); // d - 0.5 to handle midnight
}


I am not sure if my iteration is ok
d - 0.5

**Tags:** positional-astronomy

---

## 1 answers

### Answer by username_1 on 2019-10-12. Score: 1

Firstly, there is no star's sidereal time.   
Sidereal time is dependent on the current date and time. It equals the star's right ascension plus its hour angle ... which is almost the formula you provided, since the hour angle is $acos(-tg({\delta})tg({\phi}))$ only when the star's altitude is zero (also, the minus should be a plus).  
 Considering the right ascension added to the hour angle is constant for all points on the celestial sphere (since they are measured in the opposite direction, this sum will be the hour angle of the ${\gamma}$point), this formula is valid for all points, including the Sun.

> **Comments:**
> **username_1**: The code part was not there when I answered this ...  

---

