VLswapYX

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Spatial Relations
Introduced first in SolidGeometry 1.0, Creation date: 2012-04-14, Last change: 2025-09-14

y-axis becomes x-axis of a VL (z-rotation by -90 degree)

Description

z-rotation by -90 degree of a vertex list that [x y z] becomes [y -x z];
This very fast function is used if a 2D/3D drawing should be rotated 90 degree around z.
The name could also be: VLFLrotateZ270, rotate270z
Inverse procedure: VLswapXY(VL)

See Also: VLswapYZ , VLswapZY , VLswapXY , VLswapZX , VLswapXZ , VLswapX , VLswapY , VLswapZ

Example Illustration

 missing image of VLswapYX(VL)

Syntax

RVL=VLswapYX(VL)

Input Parameter

VL: Original vertex list

Output Parameter

RVL: Rotated vertex list.




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, VLswapYX, performs a specific transformation on a vertex list (VL) by rotating it around the z-axis by -90 degrees. The transformation changes the coordinates from [x y z] to [y -x z]. This is a fast operation used in 2D/3D graphics to achieve a 90-degree rotation around the z-axis.

Input Parameters

Output Results

Algorithm Explanation

The function takes the input vertex list VL and applies a transformation to each vertex. The transformation is achieved by reordering and negating the coordinates as follows:

This transformation is implemented in a single line of code:

RVL = [VL(:,2) -VL(:,1) VL(:,3)];

Here, VL(:,2) extracts the y-coordinates, -VL(:,1) negates the x-coordinates, and VL(:,3) keeps the z-coordinates unchanged. The result is a new matrix RVL with the transformed vertices.

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