using Lerp
This commit is contained in:
parent
2e275ab0d5
commit
13171c409b
|
@ -431,7 +431,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