circlesegmentofPL

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Analytical Geometry
Introduced first in SolidGeometry 5.1, Creation date: 2021-12-15, Last change: 2025-09-15

returns the angle intervall of a contour PL from a view point A0.

Description

This is helpful to create cages convex hulls for movements
Much less complex than CPLcrosscircseg

See Also: isincirclesegment , CPLcrosscircseg , angleshift , angleinterv

Example Illustration

 missing image of circlesegmentofPL(A0,PL)

Syntax

wlim=circlesegmentofPL([A0,PL])

Input Parameter

A0: Center or view Point
PL: Contour to be analyzed

Output Parameter

wlim: angle interval

Examples


circlesegmentofPL([0 0],PLcircle(4)+[10 0])
circlesegmentofPL([0 0],PLcircle(4)+[5 0])




Copyright 2021-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, circlesegmentofPL, calculates the angle interval of a contour PL from a viewpoint A0. It is part of the SolidGeometry library and is used to create convex hulls for movements.

Input Parameters

Output

Algorithm Steps

  1. Retrieve the viewpoint A0 and the contour PL from the input arguments using getfuncparams.
  2. Calculate the relative positions RL of the contour points by subtracting A0 from PL.
  3. Compute the angles w of these relative positions using the atan2 function, which returns the angle between the positive x-axis and the line to the point.
  4. Determine the minimum and maximum angles using minmaxall to find the angle interval wlim.
  5. If no output is requested, plot the viewpoint, contour, and angle interval using SGfigure, PLplot, and cplot.

Example Usage

To calculate the angle interval for a circle contour with a radius of 4, offset by [10, 0] from the origin:

circlesegmentofPL([0 0], PLcircle(4) + [10 0])

To calculate the angle interval for the same circle contour offset by [5, 0]:

circlesegmentofPL([0 0], PLcircle(4) + [5 0])
Algorithm explaination created using ChatGPT on 2025-08-19 00:19. (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