<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GameFramework
{
    public struct Vector3
    {
        public float x;
        public float y;
        public float z;

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

        public float LengthSquared
        {
            get
            {
                return x * x + y * y + z * z;
            }
        }

        public float Length
        {
            get
            {
                // TODO: provide fast float sqrt method instead of using standart one
                return (float)System.Math.Sqrt(LengthSquared);
            }
        }

        public static float Dot(Vector3 a, Vector3 b)
        {
            return a.x * b.x + a.y * b.y + a.z * b.z;
        }

        public float Dot(Vector3 that)
        {
            return Dot(this, that);
        }

        public Vector3 Cross(Vector3 a, Vector3 b)
        {
            return new Vector3(
                a.y * b.z - a.z * b.y,
                a.z * b.x - a.x * b.z,
                a.x * b.y - a.y * b.x);
        }

        public static Vector3 operator +(Vector3 a, Vector3 b)
        {
            return new Vector3(
                a.x + b.x,
                a.y + b.y,
                a.z + b.z);
        }

        public static Vector3 operator *(Vector3 vec, float scalar)
        {
            return new Vector3(
                vec.x * scalar,
                vec.y * scalar,
                vec.z * scalar);
        }

        public static Vector3 operator -(Vector3 vec)
        {
            return vec * -1f;
        }

        public static Vector3 operator -(Vector3 a, Vector3 b)
        {
            return a + (-b);<commit_msg>Add divide operator and normalized property to Vector3<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GameFramework
{
    public struct Vector3
    {
        public float x;
        public float y;
        public float z;

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

        public float LengthSquared
        {
            get
            {
                return x * x + y * y + z * z;
            }
        }

        public float Length
        {
            get
            {
                // TODO: provide fast float sqrt method instead of using standart one
                return (float)System.Math.Sqrt(LengthSquared);
            }
        }

        public Vector3 Normalized
        {
            get
            {
                return this / Length;
            }
        }

        public static float Dot(Vector3 a, Vector3 b)
        {
            return a.x * b.x + a.y * b.y + a.z * b.z;
        }

        public float Dot(Vector3 that)
        {
            return Dot(this, that);
        }

        public Vector3 Cross(Vector3 a, Vector3 b)
        {
            return new Vector3(
                a.y * b.z - a.z * b.y,
                a.z * b.x - a.x * b.z,
                a.x * b.y - a.y * b.x);
        }

        public static Vector3 operator +(Vector3 a, Vector3 b)
        {
            return new Vector3(
                a.x + b.x,
                a.y + b.y,
                a.z + b.z);
        }

        public static Vector3 operator *(Vector3 vec, float scalar)
        {
            return new Vector3(
                vec.x * scalar,
                vec.y * scalar,
                vec.z * scalar);
        }

        public static Vector3 operator /(Vector3 vec, float scalar)
        {
            return vec * (1f / scalar);
        }

        public static Vector3 operator -(Vector3 vec)
        {
            return vec * -1f;
        }

        public static Vector3 operator -(Vector3 a, Vector3 b)
        {
            return a + (-b);
{'fraction_non_alphanumeric': 0.08795269770879527, 'fraction_numerical': 0.012071938901207195, 'mean_word_length': 1.0330495743615422, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5263920', 'n_tokens_mistral': 1196, 'n_tokens_neox': 1134, 'n_words': 347}