Suppose that we have 2 line equations, call $L$, $D$, where $$L: \frac{x-a}{u}= \frac{y-b}{v}= \frac{z-c}{w}$$ $$D: \frac{x-a}{m}= \frac{y-b}{n}= \frac{z-c}{p}$$ and let $L\perp D$. Moreover, suppose that $\alpha,\beta$ are given, where $\alpha + \beta \geq \frac{\pi}{2}$. I need to find a line equation, call $K$, in the 3D space in such a way that the angle between $K$ and $L$ becomes $\alpha$ and the angle between $K$ and $D$ becomes $\beta$. I know that to achieve such a line or lines we must find the intersection between 2 cones, where the central axis of the first cone is line $L$, with half-angle $\alpha$ and the central axis of the second is the line $D$, with half-angle $\beta$. However, I don't know how to get through this process.
2026-04-11 12:35:56.1775910956
On
Specifying a line equation with respect to 2 another perpendicular line equations.
67 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
2
There are 2 best solutions below
0
On
I tried to convert Hosam Hajeer's response into a python code. That is a function gets lines and angles as inputs and returns possible line equations:
import math
def myUnitize(V):
s = math.sqrt(sum(v**2 for v in V))
W = [W/s for w in W]
return W
def newLine(T, B, P, beta, alpha):
a,b,c = P
u,v,w = myUnitize(T)
m,n,p = myUnitize(B)
alpha = math.radians(alpha)
beta = math.radians(beta)
X1 = [v*p-w*n, -u*p+w*m, u*n-v*m]
v10 = (n*math.cos(beta)-v*math.cos(alpha))/(u*n-m*v)
v20 = (u*math.cos(alpha)-m*math.cos(beta))/(u*n-m*v)
X0 = (v10, v20, 0)
A = sum(H*H for H in X1)
B = 2*sum(H*G for H, G in zip(X1, X0))
C = sum(H*H for H in X0) - 1
Delta = B**2 - 4*A*C
if Delta < 0:
return "the only intersection is the point ({},{},{}) and there is no such a line.".format(a,b,c)
r1 = (-B-math.sqrt(Delta))/(2*A)
r2 = (-B+math.sqrt(Delta))/(2*A)
v1, vv1 = X0[0]+r1*X1[0], X0[0]+r2*X1[0]
v2, vv2 = X0[1]+r1*X1[1], X0[1]+r2*X1[1]
v3, vv3 = X0[2]+r1*X1[2], X0[2]+r2*X1[2]
line_equation1 = {
"x": (a, v1),
"y": (b, v2),
"z": (c, v3)
}
line_equation2 = {
"x": (a, vv1),
"y": (b, vv2),
"z": (c, vv3)
}
return line_equation1, line_equation2
#example
P = [0,0,0]
T = [1,0,1]
B = [0,1,1]
beta = 60
alpha = 45
print(newLine(T, B, P, beta, alpha))
#result
#({'z': (0, 0.17263322206127574),
'y': (0, 0.82736677793872448),
'x': (0, 0.53447355912527195)},
{'z': (0, 0.96543796539642279),
'y': (0, 0.03456203460357743),
'x': (0, -0.25833118420987511)})
Formulation of the problem is easy. You have
$L(t) = (a,b,c) + t (u,v,w) $
$D(t) = (a,b,c) + s (m,n,p) $
where we can assume without loss of generality that $(u,v,w)$ and $(m,n,p)$ are unit vectors. We're looking for a unit vector $(v_1,v_2,v_3)$ such that it makes an angle $\alpha $ with $(u,v,w)$ and an angle $ \beta $ with $(m,n,p)$
Therefore, the triple $(v_1,v_2,v_3)$ satisfies
$ v_1 u + v_2 v + v_3 w = \cos \alpha $
$ v_1 m + v_2 n + v_3 p = \cos \beta $
$ v_1^2 + v_2^2 + v_3^2 = 1 $
It is easy to solve this system of equations because the first two equations are linear in $v_1, v_2, v_3 $, their solution takes the form
$ (v_1, v_2 , v_3) = X_0 + \lambda X_1 $
where $X_1 = (u,v,w) \times (m,n,p) $
($\times$ stands for cross product).
To find $X_0$, set $ v_3 = 0$ and solve remaining $2 \times 2$ system for $v_1$ and $v_2$. You'll get
$ v_{10} = \dfrac{ n \cos \alpha - v \cos \beta}{ u n - m v} $
$ v_{20} = \dfrac{ u \cos \beta - m \cos \alpha }{ un - mv } $
Then $X_0 = ( v_{10}, v_{20} , 0 ) $
Finally, substitute $(v_1, v_2, v_3) = X_0 + \lambda X_1 $ into
$ v_1^2 + v_2^2 + v_3^2 = 1$
This will give
$ \lambda^2 X_1 \cdot X_1 + 2 \lambda X_0 \cdot X_1 + X_0 \cdot X_0 -1 = 0 $
where $\cdot $ is the dot product.
This is a quadratic equation in $\lambda$ whose solutions can be readily found. Once these two solutions are found, the two possible vectors $(v_1, v_2, v_3) = X_0 + \lambda X_1 $ are now completely specified.
The following code is an implementation of the above procedure
The output of the program is shown below