Syntax
[T,VL]=Tofplaneparam(a,b,c,d)
Input Parameter
a : | | [a b c d] or just a |
b : | | b |
c : | | c |
d : | | d |
Output Parameter
T : | | Matrix form |
VL : | | [x 0 0; y 0 0; z 0 0; |
Examples
Tofplaneparam([1,2,3,4])
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, Tofplaneparam
, converts the parameters of a plane equation into a transformation matrix and a vertex list. The plane is defined by the equation ax + by + cz + d = 0
.
Input Parameters
- a: Can be a vector
[a b c d]
or a single value representing a
in the plane equation.
- b: Represents
b
in the plane equation, required if a
is not a vector.
- c: Represents
c
in the plane equation, required if a
is not a vector.
- d: Represents
d
in the plane equation, required if a
is not a vector.
Output Results
- T: A transformation matrix representing the plane in matrix form.
- VL: A vertex list in the form
[x 0 0; y 0 0; z 0 0]
, where x
, y
, and z
are calculated as -d/a
, -d/b
, and -d/c
respectively.
Algorithm Steps
- If only one input argument is provided, it is assumed to be a vector
[a b c d]
. The values of a
, b
, c
, and d
are extracted from this vector.
- Calculate the points
px
, py
, and pz
as [-d/a 0 0]
, [0 -d/b 0]
, and [0 0 -d/c]
respectively.
- Construct the vertex list
VL
using px
, py
, and pz
.
- Calculate the unit vector
ex
as the normalized vector from px
to py
.
- Calculate the vector
z
as the cross product of ex
and the vector from px
to pz
, then normalize it to get ez
.
- Calculate the vector
y
as the cross product of ez
and ex
, then normalize it to get ey
.
- Construct the transformation matrix
T
using ex
, ey
, ez
, and the mean of VL
.
- If no output arguments are specified, visualize the plane using functions
SGfigure
, sofBB
, tplot
, VLplot
, and VLFLplot
.
Algorithm explaination created using ChatGPT on 2025-08-19 00:23. (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