PLtrapezoid

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - PL/Point Lists
Introduced first in SolidGeometry 5.2, Creation date: 2022-07-02, Last change: 2025-09-15

returns a trapezoid shape liek the stern of a slalom water ski



See Also: PLlemo , PLcircle , PLcirctrapezoid

Example Illustration

 missing image of PLtrapezoid(b,h)

Syntax

PL=PLtrapezoid([b,h])

Input Parameter

b: base and top default is [60 90]
h: height of trapezoid; default is 210

Output Parameter

PL: Point list

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

Output

Algorithm Steps

  1. 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.
  2. If the vector b contains three elements, the third element is assigned to h, and b is reduced to its first two elements.
  3. The difference between the top and base widths, db, is calculated as b(2) - b(1).
  4. The base width b is set to the first element of the vector b.
  5. 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]
  6. 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