Simplest way to calculate the width of a segment of a convex shape

97 Views Asked by At

A convex shape $C$ is cut using a a chord. What is the width of the resulting segment? This is the length of the green thick short line in the figure below:

enter image description here

Here is my current solution:

  1. Mark the endpoints of the chord by:

$$A_1 = (x_1,y_1) = (x(t_1), y(t_1))$$

$$A_2 = (x_2,y_2) = (x(t_2), y(t_2))$$

  1. Calculate the slope of the chord:

$$s = (y_2 - y_1) / (x_2 - x_1)$$

  1. Find the point $T$ on the curve in which the tangent is paralle to the chord (the slope is equal to $s$), i.e. find the value of $t$ for which:

$$y'(t)/x'(t) = s$$

And then let:

$$T = (x_T,y_T) = (x(t),y(t))$$

  1. Calculate the distance between the point $T$ and the chord according to the formula of the distance between a line and a point:

$$\operatorname{distance} = \frac{|(y_2-y_1)x_T-(x_2-x_1)y_T+(x_2 y_1-y_2 x_1)|}{\sqrt{(y_2-y_1)^2+(x_2-x_1)^2}}. $$

Is this calculation correct?

Is there a simpler way to calculate the distance?

In particular, the most difficult step here is step 3, which requires to solve a non-linear equation. Is there a way that does not require to find the point $T$ as in step 3?