crossL

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Analytical Geometry
Introduced first in SolidGeometry 1.0, Creation date: 2010-09-04, Last change: 2025-09-14

returns the crossing points of a stright line with the main planes where z=0, x=0 or y=0

Description

PL=crossL(T) returns a 3x3 matrix PL=[px py pz]. px is the intersection point of the ez vector with the y/z-plane, py is the intersection point of the ez vector with the x/z-plane, and pz is the intersection point of the ez vector with the x/y-plane. All three points are points on the straight line.[spchk]

See Also: crossL , cross2L , crossT , cross2T , Tcross2T

Example Illustration

 missing image of crossL(T)

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

Output Results

Algorithm Steps

  1. Extract the translation vector t and the direction vector ez from the matrix T.
  2. Calculate the scaling factors kx, ky, and kz for the x, y, and z components respectively, using the formula: k = -t(i)/ez(i).
  3. Compute the intersection points px, py, and pz by adding the scaled direction vector to the translation vector: p = t + k*ez.
  4. Store the intersection points in the matrix PL.
  5. 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