Vous êtes sur la page 1sur 5

# Biarc Curve Fitting

Hakan Tiftikci
hakan.tiftikci@yahoo.com.tr
August 2009

Introduction

Biarc curve fitting determines two circular arcs passing through two given points and tangents
at those points. When applied to a series of points, it determines a piecewise circular arc
interpolation of given points.
This document summarizes the work of [ROSSIGNAC,REQUICHA]

## Formulation of Jaroslaw & Aristides

Following figure depicts a biarc curve fitting through points P1 , P2 with given tangents T1 , T2 .

a2

B2

a2

a1

B12
X2

a1

B1

P2

r2

C2

T2

Y2

P1
T1

r1

1
X
1

C1
Y1

## apex points of two segments are given by

B 1 = P 1 + a1 T 1
B 2 = P 2 a2 T 2
relations that those points must satisfy are
|B1 P1 | = |B12 B1 | = a1
|B2 P2 | = |B12 B2 | = a2
|B2 B1 | = a1 + a2

(1)
(2)
(3)

B12 = B1 +

a1
a2 B1 + a1 B2
(B2 B1 ) =
a1 + a2
a1 + a2

## Substituting definitions of B1 , B2 in basic equation

B2 B1 = (P2 a2 T2 ) (P1 + a1 T1 )
= P2 P1 (a1 T1 + a2 T2 )
and defining
P2 P1 S
basic equation becomes
|B2 B1 |2 = (a1 + a2 )2
(P2 P1 (a1 T1 + a2 T2 ))2 = (a1 + a2 )2
(S (a1 T1 + a2 T2 ))2 = (a1 + a2 )2
S2 2S (a1 T1 + a2 T2 ) + (a1 T1 + a2 T2 )2
S2 2S (a1 T1 + a2 T2 ) + a21 T21 + 2a1 a2 T1 T2 + a22 T22
S2 2S a1 T1 2S a2 T2 + a21 + 2a1 a2 T1 T2 + a22
S2 2S a1 T1 2S a2 T2 + 2a1 a2 T1 T2

= (a1 + a2 )2
= a21 + 2a1 a2 + a22
= a21 + 2a1 a2 + a22
= 2a1 a2

S2
= a1 S T 1 + a2 S T 2
2
General formula is given (in [ROSSIGNAC,REQUICHA, p. 300])
a1 a2 (T1 T2 1) +

a2 =
2.0.1

a1 (S T1 ) 21 kSk2
a1 (T1 T2 1) S T2

Specified ratio of ai

## If the ratio of two side lengths is specified

=

a2
a1

then
S2
= a1 S T1 + a1 S T2
2
S2
a21 [ (T1 T2 1)] a1 (S T1 + S T2 ) +
=0
2
this general relation has some special cases that must be handled. These cases are described in
[ROSSIGNAC,REQUICHA]
a1 a1 (T1 T2 1) +

2.1

## When junction point expressed in initial variables

a2 B 1 + a1 B 2
a1 + a2
a2 (P1 + a1 T1 ) + a1 (P2 a2 T2 )
=
a1 + a2
a2 P 1 + a2 a1 T 1 + a1 P 2 a1 a2 T 2
=
a1 + a2
a2 P1 + a1 P2 + a2 a1 (T1 T2 )
=
a1 + a2

B12 =

## chords of arcs become

a2 P1 + a1 P2 + a2 a1 (T1 T2 )
P1
a1 + a2
a2 P1 + a1 P2 + a2 a1 (T1 T2 ) (a1 + a2 ) P1
=
a1 + a2
a1 (P2 P1 ) + a2 a1 (T1 T2 )
=
a1 + a2

B12 P1 =

a2 P1 + a1 P2 + a2 a1 (T1 T2 )
P2
a1 + a2
a2 P1 + a1 P2 + a2 a1 (T1 T2 ) (a1 + a2 ) P2
=
a1 + a2
a2 (P1 P2 ) + a2 a1 (T1 T2 )
=
a1 + a2

B12 P2 =

2.2

## Computing arc center and angle

This section describes the computation of center and arc-angle of two arcs from given two points
on circle (A, C) and apex point B. Consider following figure

cos

R
()

## If points A, C are on circle and tangents to circle at A, C intersect at apex B, then

AB BC = cos (2) = D

AB BC = sin (2) a
(where a is arc-plane normal).
From
cos (2) = 2 cos2 1
= 1 2 sin2
r

1+D
r 2
1D
sin =
2 r
sin
1D
tan =
=
cos
1+D
cos =

from

AB
r
r
AB
1+D
r=
=
AB
tan
1D
tan =

from

r
BO
circle center-to-apex distance BO is computed as
cos =

BO =
then center of arc is

2.2.1

r
cos

r BA + BC

O=B+

cos
BA + BC

## Using complex numbers

Center can be found from the intersection of line segments through point a and c with directions
i (b a) , i (c b) that is
a + i (b a) = c + i (c b)
Placing P1 , P2 on real axis with midpoint

P1 +P2
2

## in origin, start and points become

s
p1 = + 0i
2
s
p2 = + + 0i
2
junction points is
b12

+ a1 2s + a2 a1 ei1 ei2
a2 s
2
=
a1 + a2
4

## and apex points are

s
b1 = + a1 ei1
2
s
b2 = + a2 ei2
2


s
s
i1
i2
s
s
i1 a2 2 +a1 2 +a2 a1 (e e )
intersection is described
For the first control triangle 2 , 2 + a1 e ,
a1 +a2
by
s
s
+ iei1 = + + iei2
2
2
i2
i1
ie ie = s
ei1 ei2 = is
cos 1 cos 2 = 0
sin 1 sin 2 = s
cos 1 sin 1 cos 2 sin 1 = 0
sin 1 cos 1 sin 2 cos 1 = s cos 1
(cos 2 sin 1 sin 2 cos 1 ) = s cos 1
s cos 1
cos 2 sin 1 sin 2 cos 1
cos 1
=
s
cos (1 + 2 )

References
[ROSSIGNAC,REQUICHA] Piecewise circular curves for geometric modeling, Jaroslaw R.
Rossignac, Aristides A.G. Requicha, IBM J. RES. DEVELOP.
VOL.3, NO.3 May 1987