Notes:Reflection of ray given normal
From Maths
Attempt 1
We are given two lines:
- ℓ1 by y:=mx+c and
- ℓ2 by y:=m′x+c′
and
- let t>0 for t∈R>0
We will find θ - the angle between ℓ1 and ℓ2
We make the following definitions:
- I - the intersection point of the lines ℓ1 and ℓ2
- p - the point which is t x-units behind I on ℓ1
- N - the normal line to ℓ1 through p
- q - the intersection of N and ℓ2
- b - the vector I−p
- c - the vector I−q
- a - the vector q−p
Then we can use any one of the following (for ∥⋅∥ the Euclidean norm):
- θ=arccos(∥b∥∥c∥)
- θ=arctan(∥a∥∥b∥)
- θ=arcsin(∥a∥∥c∥)
Solutions
To ease many expressions we make the following definitions:
- α:=c−c′m′−m,
- β:=m+1mand
- γ:=m′+1m
To obtain:
- I=(α,ℓ1(α))=(α,ℓ2(α))
- p=(α−t,ℓ1(α−t))
- q=(qx,ℓ2(qx))
- For: qx:=c−c+(α−t)βγ
- For: qx:=c−c+(α−t)βγ
- ∥a∥=√a2x+a2y, for:
- ax:=c−c′+(α−t)(β−γ)γ, and
- ay:=c′−c+(α−t)(βmm′−m2m′−m)mm′+1
- ax:=c−c′+(α−t)(β−γ)γ
- ∥b∥=|t|√1+m2=t√1+m2 as in our model t≥0 by definition
θ is found
So:
- θ=arctan(∥a∥∥b∥)
Work required
Then we just find a line with angle 2θ from the incoming ray, or −θ from the normal.
Attempt 2
I'm going to put 15 minutes into the form of line:
- (xy)=(uv)t+(ab)and perhaps if we make it unit speed parametrisation (see regular curve and arc length) things might simplify a bit more. Recall
- Dot product: A⋅B=∥a∥∥b∥cos(θ)