Syntax
o=vec2ortho(v)
Input Parameter
v : | | 2D vector list [n x 2] |
Output Parameter
Copyright 2018-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, vec2ortho
, is designed to compute orthogonal vectors for a given list of 2D vectors. It is part of the SolidGeometry library and was introduced in version 4.4.
Input Parameters
- v: A 2D vector list with dimensions [n x 2], where 'n' is the number of vectors. Each row represents a vector in 2D space.
Output Results
- o: The resulting orthogonal vectors corresponding to each input vector.
Algorithm Explanation
The function takes a matrix v
as input, where each row is a 2D vector. The goal is to compute an orthogonal vector for each input vector. The orthogonal vector is calculated by swapping the components of each vector and negating the first component. This is achieved using the following operation:
o = [-v(:,2) v(:,1)];
Here, -v(:,2)
negates the second component of each vector, and v(:,1)
retains the first component. The result is a new matrix o
where each row is an orthogonal vector to the corresponding row in v
.
Algorithm explaination created using ChatGPT on 2025-08-18 21:52. (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