Syntax
PL=PLrhombus([d,h,a])
Input Parameter
d : | | diameter in x; default is [6 6 5 2]); |
h : | | y value for each diameter; default is [0 3 4 15]
|
a : | | turning angle after design; default is 0 rad |
Output Parameter
Examples
PLrhombus([5 5 2],[0 2 10])
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)
The function PLrhombus
generates a point list for a rhombus shape based on input parameters. It is part of the SolidGeometry library.
Input Parameters
- d: A vector representing the diameters in the x-direction. The default value is
[6 6 5 2]
.
- h: A vector representing the y-values for each diameter. The default value is
[0 3 4 15]
.
- a: The turning angle after design, in radians. The default value is
0
radians.
Output
- PL: A matrix containing the points of the rhombus.
Algorithm Steps
- Retrieve the input parameters
d
, h
, and a
using the getfuncparams
function. If not provided, default values are used.
- Create an initial point list
PL
by combining half of the d
and h
values: PL = [d'/2 h'/2]
.
- Generate the remaining points of the rhombus by mirroring and inverting the initial points:
- First, mirror the x-values and keep the y-values:
PL = [PL; flipud([-PL(:,1) PL(:,2)])]
.
- Then, invert both x and y-values to complete the rhombus:
PL = [PL; -PL]
.
- Apply a rotation transformation to the point list
PL
using the angle a
with the function PLtransR
.
- If no output is requested (
nargout == 0
), plot the rhombus using SGfigure
and CPSplot
.
Algorithm explaination created using ChatGPT on 2025-08-19 00:25. (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