The new forums will be named Coin Return (based on the most recent vote)! You can check on the status and timeline of the transition to the new forums here.
The Guiding Principles and New Rules document is now in effect.

How's Your 3D Vector Math?

Akilae729Akilae729 Registered User regular
edited October 2011 in Help / Advice Forum
I'm working on a project involving re-directing the sun and I'm trying to figure out the effects of pointing errors in my re-direction mirror.

It is basically a system of three vectors, A, B and C. Where A is my incoming ray, B is the mirror normal, and C is the target. All in 3D.....

My system solves for the mirror angle which is REAL easy. B = (A+B)/|A+B|. This allows me to program a motor drive and keep the sun on a target throughout the day.

What I need to now do is solve for C when given vectors A and B. This will let me introduce different tracking and calculation errors into the system and see the effects at the target.

I know that I can do this relatively easily with rotation matrices but I'd like to keep this project living in EXCEL as opposed to MATLAB.

Can anyone think of a trick way to do this?



signaturebighe7.jpg
Akilae729 on

Posts

  • zilozilo Registered User regular
    edited October 2011
    Google "reflection vector". If N is your mirror normal, and V is your incoming ray, then the reflected vector R = V - 2*(VdotN)*N.

    You want N and V to be normalized unit vectors, btw. Vnorm = V/|V| = V/sqrt(Vx+Vy+Vz).

    zilo on
  • Akilae729Akilae729 Registered User regular
    zilo wrote:
    Google "reflection vector". If N is your mirror normal, and V is your incoming ray, then the reflected vector R = V - 2*(VdotN)*N.

    You want N and V to be normalized unit vectors, btw. Vnorm = V/|V| = V/sqrt(Vx+Vy+Vz).

    AWESOME. I knew there was a way to do this easily.

    (Turns out that MATLAB also has a built in rotation matrix tool also: vrrotvec and vrrotvec2mat)

    Let the ray tracing begin!

    signaturebighe7.jpg
  • zilozilo Registered User regular
    Using a rotation matrix would be overkill. You can get the same result with a bit of vector arithmetic (from which the above formula derives).

    You're writing a ray-tracer in Excel? Ballsy! I thought you were doing some astronomy project or something.

  • Akilae729Akilae729 Registered User regular
    zilo wrote:
    Using a rotation matrix would be overkill. You can get the same result with a bit of vector arithmetic (from which the above formula derives).

    You're writing a ray-tracer in Excel? Ballsy! I thought you were doing some astronomy project or something.

    Its a heliostat, so the only real astronomy is getting my Alt,Az values for the sun but thats what the astronomical almanac is for. The excel is just so I can quick check tracking angles and really basic errors. (Matrices in Excel would probably be lethal)

    Now that I've got some basic checks, its full on MATLAB time.

    signaturebighe7.jpg
Sign In or Register to comment.