I have different types of Circular Arc Segments. My given values are:
- the Start Point in Cartesian Coordinates (x_s, y_s)
- the Start Direction in rad (direction)
- the Radius of the Arc (radius)
- the Length of the Arc (length)
- a value stating if the direction of the Arc is counter clockwise or not
The Start Direction is defined as the bearing used i.e. in road alignments (The bearing is the direction, clockwise from North sometimes stated in degrees, minutes and seconds). In a first step, I am calculating the Centre Point (x_c, y_c) of the Arc Segment, which already works correctly.
I now need to calculate the Mid and End Point of the Arc Segment. At the moment I am using the following to do so ('dist' is the distance along the segment, and therefore 0.5 for the midpoint and 1 for the endpoint):
if arc is clockwise: angle = dist * length / radius
if arc is counter-clockwise: angle = - dist * length / radius
x = x_c + radius * cos(direction + angle) (I)
y = y_c - radius * sin(direction + angle) (II)
I am aware, that I have to somehow change the signs before 'radius' in (I) and (II) depending on whether the endpoint/midpoint is left/right or above/below x_c/y_c, but I can't figure out how I can do that with my given values.
Did anyone get an idea, how to tackle the problem?
anglein your question)? You’re computing the end and mid points of a completely different arc than the one you started with. – amd Aug 24 '17 at 16:24