vec2ortho

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Analytical Geometry
Introduced first in SolidGeometry 4.4, Creation date: 2018-12-17, Last change: 2025-09-14

creates the orthogonal vectors for a 2D vector list

Description


simply o=[-v(:,2) v(:,1)];

Example Illustration

 missing image of vec2ortho(v)

Syntax

o=vec2ortho(v)

Input Parameter

v: 2D vector list [n x 2]

Output Parameter

o: orthogonal vector




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

Output Results

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