PLarrow

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

returns a point list for an arrow



See Also: PLcircle , PLcircseg , PLevolvente , PLgearDIN , PLkidney , PLrand , PLspiral , PLsquare , PLstar , PLcircleoval , PLtubbing

Example Illustration

 missing image of PLarrow(l,h,s1)

Syntax

PL=PLarrow(l,[h,s1])

Input Parameter

l: length (x=[0..l]) or [A0;B0] Start point and End point
h: height in mm; default is 10%
s1: tip size in mm; default is h

Output Parameter

PL: Point list (open) of arrow

Examples


PLarrow(20);
PLarrow(20,5);
PLarrow(20,5,10);
PLarrow([10 10;-20 20])
PLarrow([10 10;20 +15],2,3)




Copyright 2019-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)

The function PLarrow generates a point list for an arrow shape. It is part of the SolidGeometry library and was introduced in version 4.5. The function can handle both a specified length or a start and end point for the arrow.

Input Parameters

Output

Algorithm Steps

  1. Check if l has four or more elements. If so, interpret it as start and end points A0 and B0. Calculate the direction d and angle a between these points. Update l to be the distance between A0 and B0.
  2. If l is a scalar, set A0 to an empty array and a to 0.
  3. Determine h using getfuncparams with a default of l/10.
  4. Determine s1 using getfuncparams with a default of h, then divide by 2.
  5. Calculate s9 as l - s1 and s8 as s9 - s1.
  6. Define the point list PL for the arrow shape using the calculated values.
  7. Adjust the y-coordinates of PL by scaling with h/4.
  8. If A0 is not empty, rotate and translate PL to align with the specified start and end points.
  9. If no output is requested, plot the arrow using SGfigure, PLplot, and other visualization functions.
Algorithm explaination created using ChatGPT on 2025-08-19 07:11. (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