Syntax
[ez,R,T]=ezof3P(VL)
Input Parameter
Output Parameter
ez : | | ez vector [x y z] |
R : | | Rotation Matrix [ex ey ez] |
T : | | Transformation matrix [ex ey ez p1] |
Examples
ezof3P([0 0 0;10 0 0; 0 10 0])
Copyright 2018-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, ezof3P
, calculates the unit vector ez
and the rotation matrix R
for a 3-point rotation matrix based on a given vertex list VL
.
Input Parameters
- VL: A 3x3 matrix representing a list of vertices. Each row corresponds to a point in 3D space.
Output Results
- ez: A unit vector in the direction of the z-axis of the rotation matrix.
- R: A 3x3 rotation matrix composed of unit vectors
ex
, ey
, and ez
.
- T: A transformation matrix that includes the rotation matrix and the position vector
p1
.
Algorithm Steps
- Extract the three points
p1
, p2
, and p3
from the vertex list VL
.
- Calculate the vector
x
as the difference between p2
and p1
.
- Normalize
x
to get the unit vector ex
.
- Calculate the vector
z
as the cross product of x
and the vector from p1
to p3
.
- Normalize
z
to get the unit vector ez
.
- Calculate the vector
y
as the cross product of ez
and ex
.
- Normalize
y
to get the unit vector ey
.
- Construct the rotation matrix
R
using the unit vectors ex
, ey
, and ez
.
- Compute the transformation matrix
T
using the function TofR
with inputs R
and p1
.
- If no output arguments are specified, visualize the results using plotting functions.
Algorithm explaination created using ChatGPT on 2025-08-19 00:45. (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