Appendix d: circle – line intersection points, X – x, Y – y – ElmoMC Multi-Axis Motion Controller-Maestro Motion Control User Manual

Page 72: Y = kx + (y, Kx+ c, Kx + c, X + c, 1 + k, 2*(–x, D = (c

Advertising
background image

Appendix D: Circle – line intersection

points

The line is defined by its end points (X

1

,Y

1

) and (X

2

,Y

2

). The circle is defined by its radius R and

center coordinates (X

o

, Y

o

). Consider the general case X

1

≠ X

2

and Y

1

≠ Y

2

. In this case, calculate

the intersection points using

(X – X

1

)/(X

2

– X

1

) = (Y – Y

1

)/(Y

2

– Y

1

)

(a4.1)

(X – X

o

)

2

+ (Y – Y

o

)

2

= R

2

(a4.2)

Note that

k =

(Y

2

– Y

1

)/(X

2

– X

1

)

and

C

1

= Y

1

– kX

1

equation

(a4.1)

can be written in

the following form

Y = kX + (Y

1

– kX

1

) = kX+ C

1

(a4.3)

Substituting (a4.3) into (a4.2) results in

(X – X

o

)

2

+ (kX + C

1

– Y

o

)

2

– R

2

= 0

(a4.4)

Simplifying (a4.4) results in the following equation

C

3

X

2

+ C

4

X + C

5

= 0

(a4.5)

where

C

2

= C

1

– Y

o

, C

3

= 1 + k

2

,

C

4

= 2*(–X

o

+ kC

2

), C

5

= (X

o

)

2

+ (C

2

)

2

– R

2

Note that

d = (C

4

)

2

– 4C

3

C

5

and for intersection point

X

coordinates the results are

X

1

= (–C

4

+ d

1/2

)/(2C

3

)

(a4.6)

X

2

= (–C

4

– d

1/2

)/(2C

3

)

(a4.7)

Respective

Y

coordinates can be calculated by (a4.3) as

Y

1

= kX

1

+ C

1

(a4.8)

Y

2

= kX

2

+ C

1

(a4.9)

Consider the case

X

1

= X

2

. In this case line equation

X = X

1

and substituting into (a4.2) the results are

(Y – Y

o

)

2

= R

2

– (X

1

– X

o

)

2

(a4.10)

and for Y the results are

Y

1=

Y

o

+ [R

2

– (X

1

– X

o

)

2

]

1/2

(a4.11)

Y

2=

Y

o

– [R

2

– (X

1

– X

o

)

2

]

1/2

(a4.12)

Maestro

Software Manual

MAN-MLT (Ver. 2.0)

D-1

Advertising