One thing that is not listed is how you convert this angular range to points in space. So, we start with the fact that the angle 0 is displayed in O + r *** X **, and the angle Ο / 2 is displayed in O + r ** * Y **, where O is the center of the circle and X = ( x 1 , x 2 , x 3 )) and also Y = (y 1 , y 2 , y 3 ) are unit vectors.
Thus, the circle is swept away by the function
P (? Theta) = O + rcos (? Theta;) X + rsin (? Theta) Y where? Theta; is in closed range [& thet; start , & theta; end ].
The derivative of P is equal to
P '(? Theta;) = -rsin (? Theta;) X + rcos (? Theta;) Y
To calculate the bounding box, we are interested in the points where one of the coordinates reaches an extreme value, therefore, the points where one of the coordinates P 'is equal to zero.
Setting -rsin (? Theta;) x i + rcos (? Theta;) y i = 0, we get tan (? Theta;) = sin (? Theta)) / cos (? Theta;) = y i / x i .
So we are looking for & theta; where? = arctan (y i / x i ) for i in {1,2,3}.
You should keep an eye on the details of the arctan () range and avoid division by zero, and that if & theta; this decision, i.e. & theta; ? plusmn; k * & pi ;, and I will leave this data to you.
All you have to do is find the & theta; corresponding to extreme values ββin your angular range, and calculate the bounding box of their corresponding points on the circle, and you're done. It is possible that there are no extreme values ββin the range of angles, in which case you calculate the bounding box of the points corresponding to & thet; start and & theta; end . In fact, you can also initialize your & theta; with these two values, so you have no special case.