Syntax
PL=PLtrapezoid([b,h])
Input Parameter
b : | | base and top default is [60 90] |
h : | | height of trapezoid; default is 210 |
Output Parameter
Examples
PLtrapezoid([60 90],210)
Copyright 2022-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, PLtrapezoid
, generates a trapezoid shape, specifically designed to resemble the stern of a slalom water ski. It is part of the SolidGeometry library.
Input Parameters
- b: A vector containing the base and top widths of the trapezoid. The default value is
[60 90]
.
- h: The height of the trapezoid. The default value is
210
.
Output
- PL: A list of points that define the vertices of the trapezoid.
Algorithm Steps
- The function begins by retrieving the input parameters using the
getfuncparams
function. If no parameters are provided, it defaults to b = [60 90]
and h = 210
.
- If the vector
b
contains three elements, the third element is assigned to h
, and b
is reduced to its first two elements.
- The difference between the top and base widths,
db
, is calculated as b(2) - b(1)
.
- The base width
b
is set to the first element of the vector b
.
- The point list
PL
is constructed to represent the vertices of the trapezoid. The vertices are calculated as follows:
- Bottom right corner:
[b/2, 0]
- Top right corner:
[b/2 + db/2, h]
- Top left corner:
[-b/2 - db/2, h]
- Bottom left corner:
[-b/2, 0]
- If no output is requested (i.e.,
nargout == 0
), the function calls SGfigure
to create a new figure and CPLplot
to plot the trapezoid using the point list PL
.
Algorithm explaination created using ChatGPT on 2025-08-18 23:00. (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