Syntax
PL=crossL(T)
Input Parameter
T : | | HT-Matrix of a straight line |
Output Parameter
PL : | | List of 3 Points [px py pz] of the line thorugh the main planes |
Examples
Show the crossing points of line an main planes
crossL(T2P([3 0 5],[1 1 1]))
Copyright 2010-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth
Algorithm (Workflow)
This function, crossL
, calculates the intersection points of a straight line with the main coordinate planes (x=0, y=0, z=0) using a homogeneous transformation matrix (HT-Matrix) as input.
Input Parameters
- T: A 4x4 homogeneous transformation matrix representing a straight line in 3D space.
Output Results
- PL: A 3x3 matrix containing the intersection points of the line with the main planes. Each column represents a point:
px
for the yz-plane, py
for the xz-plane, and pz
for the xy-plane.
- k: A vector containing the scaling factors
kx
, ky
, and kz
used to calculate the intersection points.
Algorithm Steps
- Extract the translation vector
t
and the direction vector ez
from the matrix T
.
- Calculate the scaling factors
kx
, ky
, and kz
for the x, y, and z components respectively, using the formula: k = -t(i)/ez(i)
.
- Compute the intersection points
px
, py
, and pz
by adding the scaled direction vector to the translation vector: p = t + k*ez
.
- Store the intersection points in the matrix
PL
.
- If no output is requested, plot the line and its intersection points with the main planes using a 3D plot.
Example Usage
To find the intersection points of a line with the main planes, use the function as follows:
crossL(T2P([3 0 5],[1 1 1]))
This example uses a line defined by a point [3 0 5]
and a direction [1 1 1]
.
Algorithm explaination created using ChatGPT on 2025-08-19 01:18. (Please note: No guarantee for the correctness of this explanation)
Last html export of this page out of FM database by TL: 2025-09-21