Re:A simple geometry question (drawing circular curves)...
Quote
> does some one know of a simple and efficient algorithm to draw a circular
> curve in the xy plane given the start and end point of this curve and the
> radius:
There is one problem: There are two such curves if you don't have any
additional parameter. Start and end point have the same distance to the
center (distance = radius), so yo search a point that's on a line
exactly between start and end point.
C1

SXE

C2
To do so first search point X with
X.x := (S.x + E.x) / 2
X.y := (S.y + E.y) / 2
With pythagoras you know:
Sqr(SX) + Sqr(XC) = Sqr(SC) where SC = Radius
You also know that XC is 90 degrees to SX, so
C.x := X.x + f*(X.yS.y)
C.y := X.y + f*(X.xS.x)
Now what is f? A factor that makes CX the right length (with the
pythagoras formula above).
sx = Sqrt(Sqr(S.xX.x)+Sqr(S.yX.y)) // distance between S and X
f = Sqrt(Sqr(Radius)Sqr(sx))/sx // divide by sx because in the formula
above you have a multiplication by something like "sx" again (just
another direction but same length)
Okay, now take +f and f and you have both centers that are possible. I
think that's all information you need to draw the curve. Right? (not
quite sure)
Well, that's just what came to my mind, not sure about all of it.
Jens