<commit_before>package in.twizmwaz.cardinal.regions.type;


import in.twizmwaz.cardinal.regions.Region;
import in.twizmwaz.cardinal.regions.parsers.SphereParser;
import in.twizmwaz.cardinal.util.NumUtils;

/**
 * Created by kevin on 10/26/14.
 */
public class SphereRegion extends Region {

    private double originX;
    private double originY;
    private double originZ;
    private double radius;

    public SphereRegion(String name, double originX, double originY, double originZ, double radius) {
        this.originX = originX;
        this.originY = originY;
        this.originZ = originZ;
        this.radius = radius;
    }

    public SphereRegion(SphereParser parser) {
        this.originX = parser.getOriginx();
        this.originY = parser.getOriginy();
        this.originZ = parser.getOriginz();
        this.radius = parser.getRadius();
    }

    public double getOriginx() {
        return originX;
    }

    public double getOriginy() {
        return originY;
    }

    public double getOriginz() {
        return originZ;
    }

    public double getRadius() {
        return radius;
    }


    @Override
    public boolean contains(BlockRegion region) {
        return NumUtils.hypotSphere(region.getX(), region.getY(), region.getZ()) <= getRadius();
    }

    @Override
    public boolean contains(PointRegion region) {
        return NumUtils.hypotSphere(region.getX(), region.getY(), region.getZ()) <= getRadius();
    }

    @Override
    public PointRegion getRandomPoint() {
        double a = NumUtils.randomInterval(0, radius);
        double b = NumUtils.randomInterval(0, 360);

        double c = NumUtils.randomInterval(0, radius);
        double d = NumUtils.randomInterval(0, 360);

        double e = NumUtils.randomInterval(0, radius);
        double f = NumUtils.randomInterval(0, 360);

        return new PointRegion(a * Math.sin(b), c * Math.sin(d), e * Math.sin(d));
    }
}<commit_msg>Corrected SphereRegion returning point about the orgin.<commit_after>package in.twizmwaz.cardinal.regions.type;


import in.twizmwaz.cardinal.regions.Region;
import in.twizmwaz.cardinal.regions.parsers.SphereParser;
import in.twizmwaz.cardinal.util.NumUtils;

/**
 * Created by kevin on 10/26/14.
 */
public class SphereRegion extends Region {

    private double originX;
    private double originY;
    private double originZ;
    private double radius;

    public SphereRegion(String name, double originX, double originY, double originZ, double radius) {
        this.originX = originX;
        this.originY = originY;
        this.originZ = originZ;
        this.radius = radius;
    }

    public SphereRegion(SphereParser parser) {
        this.originX = parser.getOriginx();
        this.originY = parser.getOriginy();
        this.originZ = parser.getOriginz();
        this.radius = parser.getRadius();
    }

    public double getOriginx() {
        return originX;
    }

    public double getOriginy() {
        return originY;
    }

    public double getOriginz() {
        return originZ;
    }

    public double getRadius() {
        return radius;
    }


    @Override
    public boolean contains(BlockRegion region) {
        return NumUtils.hypotSphere(region.getX(), region.getY(), region.getZ()) <= getRadius();
    }

    @Override
    public boolean contains(PointRegion region) {
        return NumUtils.hypotSphere(region.getX(), region.getY(), region.getZ()) <= getRadius();
    }

    @Override
    public PointRegion getRandomPoint() {
        double a = NumUtils.randomInterval(0, radius);
        double b = NumUtils.randomInterval(0, 360);

        double c = NumUtils.randomInterval(0, radius);
        double d = NumUtils.randomInterval(0, 360);

        double e = NumUtils.randomInterval(0, radius);
        double f = NumUtils.randomInterval(0, 360);

        return new PointRegion(originX + a * Math.sin(b), originY + c * Math.sin(d), originZ + e * Math.sin(d));
    }
}
{'fraction_non_alphanumeric': 0.10886075949367088, 'fraction_numerical': 0.010632911392405063, 'mean_word_length': 2.7844827586206895, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5325418', 'n_tokens_mistral': 1241, 'n_tokens_neox': 1164, 'n_words': 281}