русский
Germany.ruForen → Архив Досок→ Programmierung

Задачки любителям 3Д

23.06.21 13:16
Re: Задачки любителям 3Д
 
akidervish постоялец
in Antwort AlexNek 23.06.21 12:18, Zuletzt geändert 23.06.21 13:44 (akidervish)

То, что я написал, легко обобщается и на 3Д:



до момента получения вектора N one doesn't use the explicit coordinates, nor the dimensionality
of the space (so it works in a space of an arbitrary dimension).



So N = (X1 - X2) / |X1 - X2| (vector form!)



Then one takes two arbitrary vectors Y'1 = (x'1, y'1, z'1) and Y2, such that the three vectors N, Y1, Y2 - are linearly independent
(this is almost always the case once one takes random vectors).
Then one starts Gram-Schmidt orthogonalization process taking N as the first vector. One obtains orthonormal vectos N, N1, N2.



Two-parametric surface:
X' (t, alpha) = (X1 - X2) t + X2 + (a /2) * (N1* cos(alpha) + N2*sin(alpha)) - is a cylinder around your line, with the radius = a/2.
For the fixed parameter alpha - one obtains one of parallel lines, parametrized with t, which is parallel to the initial line, and has the distance = a/2 to it.

 

Sprung zu