mirroringatline3D

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Analytical Geometry
Introduced first in SolidGeometry 4.5, Creation date: 2019-03-16, Last change: 2025-09-14

mirrors a point at a straight line in 3D

Description

Should be renamed into VLmirroratline

See Also: PLcross2Lines , PLcrossCPLline

Example Illustration

 missing image of mirroringatline3D(P1,ev,p)

Syntax

[mp,do,cp,ov,dz]=mirroringatline3D(P1,ev,p)

Input Parameter

P1: Point on line
ev: direction vector
p: point to mirror

Output Parameter

mp: mirror point
do: distance to straight line (wrt to ev)
cp: crossing point on line
ov: orthogonal vector to straight line from p to cp
dz: distance of cp from P1

Examples


mirroringatline3D([0 0 0],[1 0 0],[2 1 3])
mirroringatline3D([0 0 0],[0 1 0],[2 1 3])
mirroringatline3D([0 0 0],[0 0 1],[2 1 3])




Copyright 2019-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)

The function mirroringatline3D is designed to mirror a point in 3D space across a straight line. It takes three input parameters and returns five output results.

Input Parameters

Output Results

Algorithm Steps

  1. Calculate the transformation matrix TE using the function Tof2P with inputs P1 and ev.
  2. Transform the point p using the inverse of the transformation matrix TE with the function VLtransT.
  3. Calculate the crossing point cp on the line by subtracting the transformed point components from p.
  4. Determine the orthogonal vector ov as the difference between cp and p.
  5. Compute the distance do as the norm of the orthogonal vector ov.
  6. Extract the distance dz from the transformed point's third component.
  7. Calculate the mirrored point mp by adding the orthogonal vector ov to the crossing point cp.
  8. If no output arguments are specified, visualize the points and line using plotting functions such as SGfigure, VLplot, and lplot.
Algorithm explaination created using ChatGPT on 2025-08-19 07:49. (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