I have had a couple of people now ask me how to turn the sun's and heliostat's altitude and azimuth into the target's altitude and azimuth. In case it is asked again, I am organizing what has been put together on this subject here.

So you know where the sun is, the mirror is already pointing a certain direction, but which direction does the reflected light go?

This is a bit different then what is normally needed. Normally, you have the sun's position, you know the required direction of the reflected light (the target), but you still need to find the altitude and azimuth of the heliostat.

This is basically what was asked by metalbag at this link.

http://cerebralmeltdown.com/forum/index.php?topic=329.msg2130#msg2130My reply to this questions was

There might be an easier way, but here is what I'm trying to do to solve this.

Basically, I thought that if I rotated the sun's vector 180 degrees around the heliostat's [vector], then that should give me the target vector.

I found the matrix for this on wikipedia. http://en.wikipedia.org/wiki/Rotation_matrix (Scroll down to where it says "Rotation matrix from axis and angle")

Since theta is 180, the trig functions simplify to 0 for sin and -1 for cos.

Out axis is the heliostat's vector, so I also substituted that it. The vector is named u in this case.

Then I just multiplied matrix R by the sun's vector (v) to get the rotated vector, which is the target vector.

I only did one simple test case to double check. It gave me the right answer, but go ahead and test it out for yourself just to be sure it works for everything.

I scanned the work and attached it to this post. I don't have the time just now to type it into code, but I figure you can do that for me.

I tried writing the vector clearly at the bottom, but let me know if you have trouble reading my handwriting.

I didn't have the chance to to do the actual coding at the time, but someone sent an email earlier who needed it so I went ahead and took the math from the image and coded it in.

I have attached it to this post. You will need to upload it to an Arduino to run it.

Believe it or not, it actually worked on the first try. That pretty much never happens to me:)