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
- a1: The first angle in radians. Default value is 0.1 radians (approximately 5.73 degrees).
- a2: The second angle in radians. Default value is 0 radians.
- h: The height of the triangle. Default value is 0.1 mm.
Output
- PL: A point list representing the vertices of a triangle.
Algorithm Steps
- Retrieve the first angle
a1
using getfuncparams
. If not provided, default to 0.1 radians.
- Retrieve the second angle
a2
using getfuncparams
. If not provided, default to an empty string.
- Retrieve the height
h
using getfuncparams
. If not provided, default to 0.1 mm.
- Calculate the base length
L1
using the formula L1 = h / tan(a1)
.
- If
a2
is not empty, calculate L2
using L2 = h / tan(a2)
. Otherwise, set L2
to 0.
- Construct the point list
PL
with vertices at coordinates [0, 0]
, [L1 + L2, 0]
, and [L1, h]
.
- If no output is requested (
nargout == 0
), plot the triangle using SGfigure
and CPLplot
with a red line.
- 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