Angles of sunrise and sunset viewed from a surface anyway oriented I need to understand how to calculate the angles of the sunrise and sunset viewed from a surface oriented against the azimuth and  the horizon plane, and for any day of the year.

For example, I have a surface at this position 40° 43' 30.2"N 73° 59' 37.5"W, oriented towards north with an azimuth angle of 174°(O° is exactly the geometric south), and with a tilt angle of 90°,so the surface is vertical, or perpendicular to the horizon. 

How could I calculate when it get the sun and when it doesn't during the day? 
What are these angles against the azimuth axis?

In my example, sun should hit the surface when it rises, then it disappears, it reappears at the end of the day before of its set, mainly in the summer season. So in this case, I need to know four angles: -ws,w1,w2,ws, where -ws, and ws are the regular angle of rise and set, but how to calculate when sun disappears (w1), and appears again to the surface (w2)? 

Do you know the complete formulas to these calculations? 

Do you know any websites, or any web app to do exactly these type of calculations? 

What about the regular case when the same surface in the same place and position but with its normal towards south? 

I'm not very interested in the theory but in the practical calculation. I tried the formulas on this website (http://www.itacanet.org/the-sun-as-a-source-of-energy/part-3-calculating-solar-angles/) but it is not clear what happens if Azs=0°, that is when the surface is towards north. In the calculation of a and b for the formula 3.7 I get at the denominator sin(0)=0, times tan(beta=90°)=inf, if the surface is vertical!! How could I solve this problem?
In other words, at what hour angle $h$ is the Sun's azimuth $\mathtt{Az}_s$ at a right angle to the wall's normal vector (84$^\circ$ or 264$^\circ$)?

Using these formulas, which I've checked, from
Wikipedia: Solar azimuth angle,
$$\sin \phi_s = \frac{-\sin h \cos \delta}{\sin \theta_s} \\
\cos \phi_s = \frac{\sin \delta \cos \Phi - \cos h \cos \delta \sin \Phi}{\sin \theta_s}$$
where $\phi_s$ is the Sun's north-clockwise azimuth,
$\theta_s$ is the Sun's zenith angle (90$^\circ$ - $\mathtt{Alt}_s$),
$\delta$ is the Sun's declination,
and $\Phi$ is your geographic latitude.
Then $\tan \phi_s = \sin \phi_s / \cos \phi_s$, and
$$\phi_s = \mathtt{atan2}(-\sin h \cos \delta, \ \sin \delta \cos \Phi - \cos h \cos \delta \sin \Phi)$$
This formula yields results consistent with the
NOAA Solar Calculator in my tests.
We need to solve for $h$, but how isn't yet obvious to me; maybe someone else can help?

Notes:


The relation between $\phi_s$ and $\mathtt{Az}_s$ depends on whether $\mathtt{Az}_s$ is south-clockwise, south-counterclockwise, or the more conventional north-clockwise.
$h$ here is the same as $\omega$ in the ITACA article.
As you observed, formula 3.7 is undefined for a wall facing due north or south.
I find their azimuth notation confusing (is AAZ an alias for AZS or something else?) and the $\alpha$ on the left side of equation 3.9 is a mistake.
I believe ITACA formula 3.11 is correct. If we let $\cos \theta_i$ = 0, it reduces to something like the above where the surface is vertical, but it has the same difficulty of solving for $\omega$.