Vector for arcs in path

179 Views Asked by At

I have path created from lines and arcs. I want to create next path inside or outside of this given path with given offset. For line I calculate line equation and it gives me simple perpendicular vector Ax+By+C=0 => v=[-B,A]. For arc I calculate vector from center point and point in the middle of arc. Then I normalize all vectors and multiply them by my given offset. This solution is not perfect because vector of arc sometimes goes inside sometimes outside of my path. I always know direction of my lines and arcs - direction of my "move" on path.

path

Is there a way to calculate this vector different, better way or be sure that direction is OK.