Given a line with slope y/x, find a simple formula for the slope of a second line that forms a 45 degree angle with this line (find slopes for both 45 degrees more and 45 degrees less.)
This can be done without trigonometry.
Find a general formula for any angle.
This requires trigonometry.
Let (0,0) and (x,y) be the coordinates of points O and A
respectively. The slope of OB (where OAB is an isosceles
right triangle, CCW) gives the slope for 45 degrees more
B = (x,y) + (-y,x) = (x-y,x+y)
x+y
slope(OB) = -----
x-y
The slope of OC (where OAC is an isosceles right triangle, CW)
gives the slope for 45 degrees less
C = (x,y) - (-y,x) = (y+x,y-x)
y-x
slope(OC) = -----
y+x
Let p/q be the slope of the general angle V and y/x the slope
of angle U.
y p
--- + ---
tan(U) + tan(V) x q px + qy
tan(U+V) = ------------------- = ------------- = ---------
1 - tan(U)*tan(V) y p qx - py
1 - ---*---
x q
y p
--- - ---
tan(U) - tan(V) x q qy - px
tan(U-V) = ------------------- = ------------- = ---------
1 + tan(U)*tan(V) y p py + qx
1 + ---*---
x q
Note: If V = 45, then p = q and we get the slopes of the first
part of the problem.
Edited on March 21, 2006, 4:40 pm
|
Posted by Bractals
on 2006-03-21 16:39:26 |