<commit_before>package me.zero.client.api.util.math;

import me.zero.client.api.util.render.GlUtils;
import org.lwjgl.BufferUtils;
import org.lwjgl.opengl.Display;
import org.lwjgl.util.glu.GLU;

import java.nio.FloatBuffer;
import java.nio.IntBuffer;

import static org.lwjgl.opengl.GL11.*;

/**
 * Vector with an X and Y position
 *
 * @since 1.0
 *
 * Created by Brady on 2/12/2017.
 */
public final class Vec2 {

    /**
     * Coordinates of this vector
     */
    private float x, y;

    public Vec2(double x, double y) {
        this((float) x, (float) y);
    }

    public Vec2(float x, float y) {
        this.x = x;
        this.y = y;
    }

    /**
     * Sets the Vector X value
     *
     * @since 1.0
     *
     * @param x The new X value
     * @return This Vector
     */
    public final Vec2 x(float x) {
        this.x = x;
        return this;
    }

    /**
     * Sets the Vector Y value
     *
     * @since 1.0
     *
     * @param y The new Y value
     * @return This Vector
     */
    public final Vec2 y(float y) {
        this.y = y;
        return this;
    }

    /**
     * @since 1.0
     *
     * @return The vector x value
     */
    public final float getX() {
        return this.x;
    }

    /**
     * @since 1.0
     *
     * @return The vector y value
     */
    public final float getY() {
        return this.y;
    }

    /**
     * Adds the X and Y of one vector to this vector
     *
     * @since 1.0
     *
     * @param vector Vector being added
     * @return The new vector
     */
    public final Vec2 add(Vec2 vector) {
        return new Vec2(this.x + vector.x, this.y + vector.y);
    }

    /**
     * Adds the specified X and Y to this vector
     *
     * @since 1.0
     *
     * @param x X value being added
     * @param y Y value being added
     * @return The new vector
     */
    public final Vec2 add(double x, double y) {
        return add(new Vec2(x, y));
    }

    /**
     * Adds the specified X and Y to this vector
     *
     * @since 1.0
     *
     * @param x X value being added
     * @param y Y value being added
     * @return The new vector
     */
    public final Vec2 add(float x, float y) {
        return add(new Vec2(x, y));
    }

    /**
     * Subtracts the X and Y of one vector from this vector
     *
     * @since 1.0
     *
     * @param vector Vector being subtracted by
     * @return The new vector
     */
    public final Vec2 sub(Vec2 vector) {
        return new Vec2(this.x - vector.x, this.y - vector.y);
    }

    /**
     * Subtracts the specified X and Y from this vector
     *
     * @since 1.0
     *
     * @param x X value being subtracted
     * @param y Y value being subtracted
     * @return The new vector
     */
    public final Vec2 sub(double x, double y) {
        return add(new Vec2(x, y));
    }

    /**
     * Subtracts the specified X and Y from this vector
     *
     * @since 1.0
     *
     * @param x X value being subtracted
     * @param y Y value being subtracted
     * @return The new vector
     */
    public final Vec2 sub(float x, float y) {
        return add(new Vec2(x, y));
    }

    /**
     * Multiplies the X and Y of this vector by a scale
     *
     * @since 1.0
     *
     * @param scale The scale
     * @return The new vector
     */
    public final Vec2 scale(float scale) {
        return new Vec2(this.x * scale, this.y * scale);
    }

    /**
     * Creates a Vec3 from this Vec2
     *
     * @since 1.0
     *
     * @return This Vec2 as a Vec3
     */
    public final Vec3 toVec3() {
        return new Vec3(x, y, 0);
    }

    /**
     * Calculates the distance to another Vec2
     *
     * @since 1.0
     *<commit_msg>Fixed math error in Vec2<commit_after>package me.zero.client.api.util.math;

import me.zero.client.api.util.render.GlUtils;
import org.lwjgl.BufferUtils;
import org.lwjgl.opengl.Display;
import org.lwjgl.util.glu.GLU;

import java.nio.FloatBuffer;
import java.nio.IntBuffer;

import static org.lwjgl.opengl.GL11.*;

/**
 * Vector with an X and Y position
 *
 * @since 1.0
 *
 * Created by Brady on 2/12/2017.
 */
public final class Vec2 {

    /**
     * Coordinates of this vector
     */
    private float x, y;

    public Vec2(double x, double y) {
        this((float) x, (float) y);
    }

    public Vec2(float x, float y) {
        this.x = x;
        this.y = y;
    }

    /**
     * Sets the Vector X value
     *
     * @since 1.0
     *
     * @param x The new X value
     * @return This Vector
     */
    public final Vec2 x(float x) {
        this.x = x;
        return this;
    }

    /**
     * Sets the Vector Y value
     *
     * @since 1.0
     *
     * @param y The new Y value
     * @return This Vector
     */
    public final Vec2 y(float y) {
        this.y = y;
        return this;
    }

    /**
     * @since 1.0
     *
     * @return The vector x value
     */
    public final float getX() {
        return this.x;
    }

    /**
     * @since 1.0
     *
     * @return The vector y value
     */
    public final float getY() {
        return this.y;
    }

    /**
     * Adds the X and Y of one vector to this vector
     *
     * @since 1.0
     *
     * @param vector Vector being added
     * @return The new vector
     */
    public final Vec2 add(Vec2 vector) {
        return new Vec2(this.x + vector.x, this.y + vector.y);
    }

    /**
     * Adds the specified X and Y to this vector
     *
     * @since 1.0
     *
     * @param x X value being added
     * @param y Y value being added
     * @return The new vector
     */
    public final Vec2 add(double x, double y) {
        return add(new Vec2(x, y));
    }

    /**
     * Adds the specified X and Y to this vector
     *
     * @since 1.0
     *
     * @param x X value being added
     * @param y Y value being added
     * @return The new vector
     */
    public final Vec2 add(float x, float y) {
        return add(new Vec2(x, y));
    }

    /**
     * Subtracts the X and Y of one vector from this vector
     *
     * @since 1.0
     *
     * @param vector Vector being subtracted by
     * @return The new vector
     */
    public final Vec2 sub(Vec2 vector) {
        return new Vec2(this.x - vector.x, this.y - vector.y);
    }

    /**
     * Subtracts the specified X and Y from this vector
     *
     * @since 1.0
     *
     * @param x X value being subtracted
     * @param y Y value being subtracted
     * @return The new vector
     */
    public final Vec2 sub(double x, double y) {
        return sub(new Vec2(x, y));
    }

    /**
     * Subtracts the specified X and Y from this vector
     *
     * @since 1.0
     *
     * @param x X value being subtracted
     * @param y Y value being subtracted
     * @return The new vector
     */
    public final Vec2 sub(float x, float y) {
        return sub(new Vec2(x, y));
    }

    /**
     * Multiplies the X and Y of this vector by a scale
     *
     * @since 1.0
     *
     * @param scale The scale
     * @return The new vector
     */
    public final Vec2 scale(float scale) {
        return new Vec2(this.x * scale, this.y * scale);
    }

    /**
     * Creates a Vec3 from this Vec2
     *
     * @since 1.0
     *
     * @return This Vec2 as a Vec3
     */
    public final Vec3 toVec3() {
        return new Vec3(x, y, 0);
    }

    /**
     * Calculates the distance to another Vec2
     *
     * @since 1.0
     *
{'fraction_non_alphanumeric': 0.10675293166194905, 'fraction_numerical': 0.01819652244237768, 'mean_word_length': 1.5971298564928247, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6266765', 'n_tokens_mistral': 2544, 'n_tokens_neox': 2449, 'n_words': 842}