Approximate an Arc by Line Segments
SummaryGiven an arc with known center, start and end point, get a series of line segments to approximate the arc.
The QuestionGiven a 2D arc with arc center point c, start point s and end point e, find a series of line segments to approximate the arc. The arc's sweep angle < 180. The minimum number of required line segments is also given.
The Solution
|
For the 2 new arcs, repeat the same process to get point A2 and A3. This gives line segments
s-A2, A2-A1, A1-A3, A3-e. Repeat this process until the required number of segments is met. |
- Arcs can be in 3D without needing to calculate angles and worry about the arc direction
- Does not use expensive sin() and cos() functions, thus high performance.