# Calculate path of laser beam?

Lets say we have a laser beam emitter that has a position and an angle (in a 2D world to simplify things). The laser emitted from that emitter will start at that position, and continue heading in the direction of the angle until it intersects with an object (some arbitrary polygon). If that object is reflective, the laser should bounce off the surface that it first intersects. This continues until the laser hits a non-reflective surface.

I guess the problem here can be divided into two problems: finding the first intersection and calculating the new angle from that intersection. I'm not exactly sure how to solve the first problem, but I figure the second one can be solved by finding the angle between the laser and the normal vector (i think that's what it's called) and calculating the new angle using that.

-
Your first question can't be answered, as you're not really specific about it. Maybe look into "Ray - Line intersection"? Your second question has been answered in this question: gamedev.stackexchange.com/questions/23672/… – bummzack Feb 22 '12 at 14:08
I'm sorry, what additional information do I need to specify? I was looking for a general answer. – Rahat Ahmed Feb 22 '12 at 14:13
I was thinking about something like your edit. It wasn't clear if this is 2D, 3D, if it's vs. lines, polygons, curves, metaballs or whatever :). But nevermind, your edit cleared things up a bit. – bummzack Feb 22 '12 at 17:06