limitinterv

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Auxiliary function
Introduced first in SolidGeometry 5.3, Creation date: 2023-03-04, Last change: 2025-09-15

value between [min and max]



See Also: angleinterv , distofintervall

Example Illustration

 missing image of limitinterv(x,xlim)

Syntax

y=limitinterv(x,xlim)

Input Parameter

x: number
xlim: [min max]

Output Parameter

y: value between [min and max]

Examples


limitinv(10,[5 20]), limitinv(-10,[5 20]), limitinv(30,[5 20])





Copyright 2023-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, limitinterv, is designed to constrain a given number within a specified range. It is part of the SolidGeometry library, version 5.3, and was created by Tim C. Lueth in 2023.

Input Parameters

Output

Algorithm Steps

  1. Check if x is less than the minimum limit xlim(1):
    • If true, set y to xlim(1).
  2. Check if x is greater than the maximum limit xlim(2):
    • If true, set y to xlim(2).
  3. If neither condition is met, set y to x.

Example Usage

Here are some examples of how the function can be used:

Algorithm explaination created using ChatGPT on 2025-08-18 22:20. (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