using Lerp
This commit is contained in:
parent
cff8697c97
commit
4b6cf201f7
|
@ -423,7 +423,7 @@ func (c Circle) Union(d Circle) Circle {
|
||||||
|
|
||||||
// Calculate center for encompassing Circle
|
// Calculate center for encompassing Circle
|
||||||
theta := .5 + (biggerC.Radius-smallerC.Radius)/(2*dist)
|
theta := .5 + (biggerC.Radius-smallerC.Radius)/(2*dist)
|
||||||
center := smallerC.Center.Scaled(1 - theta).Add(biggerC.Center.Scaled(theta))
|
center := Lerp(smallerC.Center, biggerC.Center, theta)
|
||||||
|
|
||||||
return Circle{
|
return Circle{
|
||||||
Radius: r,
|
Radius: r,
|
||||||
|
|
Loading…
Reference in New Issue