Message 1 of 3

Not applicable
03-06-2017
07:09 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have converted a circle into polyline segments for a program i am writing and want to calculate the bulges of each polyline in the circle. I have written the follow code to calculate the bulges of each section of the circle.
double getBulge( double r, AcGePoint3d a, AcGePoint3d b ) { double dist = sqrt( ( b.x - a.x ) * ( b.x - a.x ) + ( b.y - a.y ) * ( b.y - a.y ) ); double angle = acos( ( ( 2 * r * r ) - ( dist * dist ) ) / ( 2 * r * r ) ); double bulge = tan( angle * 0.25 ); return bulge; }
My problem is that sometimes the bulges are in the wrong direction on the circle see the following image. You can see that in the circles at the top of the screen shot the bulges are calculated correctly and for the circles at the bottom they are incorrect. Is there a way to figure out the direction of a bulge in a circle segment?
Solved! Go to Solution.