wlim=circlesegmentofPL([A0,PL])
A0 : | Center or view Point | |
PL : | Contour to be analyzed |
wlim : | angle interval |
circlesegmentofPL([0 0],PLcircle(4)+[10 0])
circlesegmentofPL([0 0],PLcircle(4)+[5 0])
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.
A0
and the contour PL
from the input arguments using getfuncparams
.RL
of the contour points by subtracting A0
from PL
.w
of these relative positions using the atan2
function, which returns the angle between the positive x-axis and the line to the point.minmaxall
to find the angle interval wlim
.SGfigure
, PLplot
, and cplot
.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)