Syntax
[a,b,c]=p3ofn(n)
Input Parameter
Output Parameter
Copyright 2012-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, p3ofn
, is designed to return three indices based on a given number n
. It is part of the SG-Library and was created by Tim Lueth. The function is used to select three indices from a contour list to define vertices for calculating a homogeneous transformation (HT) matrix, which is used in TofPCVL.
Input Parameters
- n: A number that determines the indices to be returned.
- varargin: An optional parameter that can specify a solution type.
Output Results
- a: The first index.
- b: The second index.
- c: The third index.
Algorithm Details
The function begins by setting a default value for solut
to 0. If a second argument is provided and is not empty, solut
is set to this value.
Switch Conditions
- Case 0:
a = 1
b = n + 1 - round(n * 0.666)
c = n + 1 - round(n * 0.333)
This case calculates b
and c
by subtracting rounded fractions of n
from n + 1
.
- Case 1:
a = round(n * 0.333)
b = round(n * 0.666)
c = n
This case assigns a
and b
as rounded fractions of n
, with c
set to n
.
- Default Case:
This case assigns the values 1, 2, and 3 to a
, b
, and c
respectively.
Algorithm explaination created using ChatGPT on 2025-08-18 22:28. (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