Sign in to follow this  
vicer1234

Snells law

Recommended Posts

Hi,
I am trying to implement Snells law as a simulation.
Snells law: Sin A/ Sin B =V1/V2 = n2/n1
Couple of things I am thinking as possible implementation method are:

1) Showing ray of light using LINE.
2) After calculation I am thinking of showing the refraction or reflection by another line. Taking the angle into calculation.

let me know whether the above assumptions are right of doing

Also one major doubt is:
How to calculate the angle when line( Ray of light ) hits at any random surface of the object.

I am using C++ and Opengl for implementation

All suggestions are welcome

Share this post


Link to post
Share on other sites
It is often best to ask how to calculate the sine of the angle, because there may be a direct way to calculate it without calling the sine function on an angle. In particular, if you have the normal of the surface, you can use the [url="http://en.wikipedia.org/wiki/Cross_product"]cross product[/url] (or the [url="http://mathworld.wolfram.com/PerpDotProduct.html"]perpendicular dot product[/url] in 2D) between the normal and the direction of the line (maybe negated - draw a picture to find what vector you need).

Share this post


Link to post
Share on other sites
But you don't really need to calculate the sine of the angle and use that equation. You should probable rewrite the entire equation in "vector form". You can find it on [url="http://en.wikipedia.org/wiki/Snell"]wikipedia[/url].

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this