Syntax
PL=PLofFloorPlan(FP)
Input Parameter
Output Parameter
Examples
PLofFloorPlan([100 90; 200 90; 300 90])
Copyright 2016-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, PLofFloorPlan
, converts a distance-angle list into a point list, representing a closed polygon. It is part of the SolidGeometry library and was introduced by Tim Lueth.
Input Parameters
- FP: A matrix where each row contains a distance and an angle in degrees. This list defines the segments of the floor plan.
Output Results
- PL: A matrix representing the list of points that form the vertices of the polygon.
Algorithm Steps
- Determine the number of segments,
n
, from the number of rows in FP
.
- Initialize a point list,
PL
, with zeros, having n+1
rows and 2 columns.
- Initialize a transformation matrix,
T
, as a 3x3 identity matrix.
- Iterate over each segment in
FP
:
- For each segment, update the transformation matrix
T
by multiplying it with the transformation matrix obtained from the function TofDPhi
, which takes the distance and the angle (converted to radians) as inputs.
- Extract the x and y coordinates from the transformation matrix and store them in the point list
PL
.
- Calculate the distance
Delta
between the first and last points in PL
.
- If
Delta
is less than 1, set the last point in PL
to be the same as the first point, ensuring the polygon is closed.
- Swap the columns of
PL
to mirror the points.
- If no output is requested, plot the point list using
PLplot
and set the view to a top-down perspective.
Algorithm explaination created using ChatGPT on 2025-08-18 23:47. (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