distT

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

returns orthogonal vector and normal vector to T-plane

Description

Shortest distance to x/y-plane is always the z value.
The normal vector is simply [0 0 z].
The position on the straight line is p-o
The position on the plane is p-n
The projection line is from p-n to p-n-o

See Also: distE , planedistanceofT , VLisbelowT

Example Illustration

 missing image of distT(T,p)

Syntax

[o,n]=distT(T,p)

Input Parameter

T: 4x4 Homogenous Transformation Matrix
p: 1x3 or 3x1 vector

Output Parameter

o: orthogonal vector: 1x3
n: normal vector: 1x3

Examples


T=TofR(rot(pi/16,pi/8,pi/12),[2 2 2]), p=[30 20 10]
distT(T,p)




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 calculates the orthogonal and normal vectors to a plane defined by a 4x4 homogeneous transformation matrix T, given a point p.

Input Parameters

Output Results

Algorithm Steps

  1. Convert the point p into a column vector if it is not already.
  2. Calculate the orthogonal vector o using the function distE, which computes the shortest distance from the point to the plane.
  3. Transform the orthogonal vector back to the original coordinate system using the transformation matrix T.
  4. Extract the first three components of the transformed vector to get the final orthogonal vector o.
  5. Calculate the normal vector n as the difference between the point p and the orthogonal vector o.
  6. If no output arguments are specified, visualize the results using various plotting functions:
Algorithm explaination created using ChatGPT on 2025-08-19 01:14. (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