PLtriangle

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - PL/Point Lists
Introduced first in SolidGeometry 4.9, Creation date: 2020-02-24, Last change: 2025-09-14

returns a triangle from an agle



See Also: PLsample

Example Illustration

 missing image of PLtriangle(a1,a2,h)

Syntax

PL=PLtriangle([a1,a2,h])

Input Parameter

a1: angle; default 1e-2
a2: angle; default is 0
h: height of the triangle

Output Parameter

PL: Point list of a single triangle

Examples


PLtriangle(1e-1,2e-1)
PLtriangle(1e-)




Copyright 2020-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, PLtriangle, generates a point list representing a triangle based on input angles and height. It is part of the SolidGeometry library.

Input Parameters

Output

Algorithm Steps

  1. Retrieve the first angle a1 using getfuncparams. If not provided, default to 0.1 radians.
  2. Retrieve the second angle a2 using getfuncparams. If not provided, default to an empty string.
  3. Retrieve the height h using getfuncparams. If not provided, default to 0.1 mm.
  4. Calculate the base length L1 using the formula L1 = h / tan(a1).
  5. If a2 is not empty, calculate L2 using L2 = h / tan(a2). Otherwise, set L2 to 0.
  6. Construct the point list PL with vertices at coordinates [0, 0], [L1 + L2, 0], and [L1, h].
  7. If no output is requested (nargout == 0), plot the triangle using SGfigure and CPLplot with a red line.
  8. Draw a line from [L1, 0] to [L1, h] in black and label it with 'h'.
Algorithm explaination created using ChatGPT on 2025-08-18 23:17. (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