/*
 * Copyright 2014 MovingBlocks
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.terasology.math.geom;


/**
 * Defines a circle
 * @author Martin Steiger
 */
public final class Circle implements Shape {

    private final ImmutableVector2d center;
    private final double radius;

    /**
     * @param centerX the center X coord
     * @param centerY the center Y coord
     * @param radius the radius
     */
    public Circle(double centerX, double centerY, double radius) {
        this.center = new ImmutableVector2d(centerX, centerY);
        this.radius = radius;
    }

    @Override
    public String toString() {
        return "Circle [center: " + center + ", radius: " + radius + "]";
    }

    /**
     * @return the center of the cirle
     */
    public ImmutableVector2d getCenter() {
        return center;
    }

    /**
     * @return the radius of the circle
     */
    public double getRadius() {
        return radius;
    }

    @Override
    public boolean contains(BaseVector2d v) {
        double dx = v.x() - center.x();
        double dy = v.y() - center.y();

        return dx * dx + dy * dy <= radius * radius;
    }
}


@@ -741,25 +741,16 @@
 e final 
-Immutable
 Vector2d
@@ -754,24 +754,24 @@
 r2d center;%0A
+
     private 
@@ -1015,33 +1015,237 @@
 r = new 
-Immutable
+Vector2d(centerX, centerY);%0A        this.radius = radius;%0A    %7D%0A%0A    /**%0A     * @param centerX the center X coord%0A     * @param centerY the center Y coord%0A     * @param radius the radius%0A     */%0A    public Circle(
 Vector2d
 (centerX
@@ -1236,34 +1236,70 @@
 Vector2d
-(
+ 
 center
-X
 , 
+double radius) %7B%0A        this.center = 
 center
-Y)
 ;%0A      
@@ -1502,32 +1502,32 @@
 e cirle%0A     */%0A
+
     public Immut
@@ -1525,17 +1525,8 @@
 lic 
-Immutable
 Vect

Make Circle consistent with other shapes