VLdistance

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Analytical Geometry
Introduced first in SolidGeometry 3.8, Creation date: 2017-05-24, Last change: 2025-09-14

returns a distance list - but is different from VLnorm

Description

Version 4.0 is 10-20 times faster than 3.9
VLnorm - vertex normal vector; not defined for the first value
VLdistance - vertex distance vector; not defined for the last value
The results seem to be circulated by one
VLdistance is looking forward
VLnorm is looking backward

See Also: VLnorm , VLangle , PLlength

Example Illustration

 missing image of VLdistance(VL)

Syntax

[DL,DVL]=VLdistance(VL)

Input Parameter

VL: Vertex list

Output Parameter

DL: Distance list
DVL: Distance vector list

Examples


VLnorm(VLsample(3))
VLdistance(VLsample(3))




Copyright 2017-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 VLdistance calculates the distance between consecutive vertices in a given vertex list (VL). It is part of the SolidGeometry library and is designed to be efficient, with version 4.0 being significantly faster than previous versions.

Input Parameters

Output Results

Algorithm Explanation

The function begins by checking if any input arguments are provided. If not, it defaults to using VLui as the vertex list.

The core of the function involves calculating the distance between each vertex and the next one in the list. This is achieved by using the circshift function to shift the vertex list by one position, effectively aligning each vertex with its successor. The difference between these aligned lists is then passed to the VLnorm function, which computes the distance vector list (DVL) and the distance list (DL).

The function is optimized for speed, as indicated by the comment that it is 10 times faster than using VLangle for the same purpose.

Note: The function does not define the first value for VLnorm and the last value for VLdistance, as these are inherently undefined in the context of the operation being performed.

Algorithm explaination created using ChatGPT on 2025-08-19 00:13. (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