diff --git a/geometry.go b/geometry.go index b19e902..a3d0996 100644 --- a/geometry.go +++ b/geometry.go @@ -366,14 +366,9 @@ func (c Circle) Norm() Circle { } } -// Diameter returns the diameter of the Circle. -func (c Circle) Diameter() float64 { - return c.Radius * 2 -} - // Area returns the area of the Circle. func (c Circle) Area() float64 { - return math.Pi * c.Diameter() + return math.Pi * c.Radius * 2 } // Moved returns the Circle moved by the given vector delta. diff --git a/geometry_test.go b/geometry_test.go index a3aa5f8..0a74ffa 100644 --- a/geometry_test.go +++ b/geometry_test.go @@ -275,42 +275,6 @@ func TestCircle_Norm(t *testing.T) { } } -func TestCircle_Diameter(t *testing.T) { - type fields struct { - radius float64 - center pixel.Vec - } - tests := []struct { - name string - fields fields - want float64 - }{ - { - name: "Circle.Diameter(): positive radius", - fields: fields{radius: 10, center: pixel.V(0, 0)}, - want: 20, - }, - { - name: "Circle.Diameter(): zero radius", - fields: fields{radius: 0, center: pixel.V(0, 0)}, - want: 0, - }, - { - name: "Circle.Diameter(): negative radius", - fields: fields{radius: -5, center: pixel.V(0, 0)}, - want: -10, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - c := pixel.C(tt.fields.radius, tt.fields.center) - if got := c.Diameter(); got != tt.want { - t.Errorf("Circle.Diameter() = %v, want %v", got, tt.want) - } - }) - } -} - func TestCircle_Area(t *testing.T) { type fields struct { radius float64