<commit_before>// Copyright (c) 2012 krepa098 (krepa098 at gmail dot com)
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose, including commercial applications,
// and to alter it and redistribute it freely, subject to the following restrictions:
// 	1.	The origin of this software must not be misrepresented; you must not claim that you wrote the original software.
//			If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
// 	2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
// 	3. This notice may not be removed or altered from any source distribution.

package gosfml2

// #include <SFML/System.h>
// int getSizeVector2i() { return sizeof(sfVector2i); }
// int getSizeVector2u() { return sizeof(sfVector2u); }
// int getSizeVector2f() { return sizeof(sfVector2f); }
// int getSizeVector3f() { return sizeof(sfVector3f); }
import "C"
import "math"

/////////////////////////////////////
///		STRUCTS
/////////////////////////////////////

type Vector2i struct {
	X, Y int
}

type Vector2u struct {
	X, Y uint
}

type Vector2f struct {
	X, Y float32
}

type Vector3f struct {
	X, Y, Z float32
}

/////////////////////////////////////
///		FUNCS
/////////////////////////////////////

/////////////////////////////////////
// Vector2i

// Returns the sum of two vectors.
func (this Vector2i) Plus(other Vector2i) Vector2i {
	return Vector2i{X: this.X + other.X, Y: this.Y + other.Y}
}

// Returns the difference of two vectors.
func (this Vector2i) Minus(other Vector2i) Vector2i {
	return Vector2i{X: this.X - other.X, Y: this.Y - other.Y}
}

// Returns the length of the vector.
func (this Vector2i) Length() float32 {
	return float32(math.Sqrt(float64(this.X*this.X + this.Y*this.Y)))
}

// Returns scale times the vector
func (this Vector2i) Scale(scale int) Vector2i {
	return Vector2i{X: this.X * scale, Y: this.Y * scale}
}

/////////////////////////////////////
// Vector2u

// Returns the sum of two vectors.
func (this Vector2u) Plus(other Vector2u) Vector2u {
	return Vector2u{X: this.X + other.X, Y: this.Y + other.Y}
}

// Returns the difference of two vectors.
func (this Vector2u) Minus(other Vector2u) Vector2u {
	return Vector2u{X: this.X - other.X, Y: this.Y - other.Y}
}

// Returns the length of the vector.
func (this Vector2u) Length() float32 {
	return float32(math.Sqrt(float64(this.X*this.X + this.Y*this.Y)))
}

// Returns scale times the vector
func (this Vector2u) Scale(scale uint) Vector2u {
	return Vector2u{X: this.X * scale, Y: this.Y * scale}
}

/////////////////////////////////////
// Vector2f

// Returns the sum of two vectors.
func (this Vector2f) Plus(other Vector2f) Vector2f {
	return Vector2f{X: this.X + other.X, Y: this.Y + other.Y}
}

// Returns the difference of two vectors.
func (this Vector2f) Minus(other Vector2f) Vector2f {
	return Vector2f{X: this.X - other.X, Y: this.Y - other.Y}
}

// Returns scale times the vector
func (this Vector2f) Scale(scale float32) Vector2f {
	return Vector2f{X: this.X * scale, Y: this.Y * scale}
}

// Returns the length of the vector.
func (this Vector2f) Length() float32 {
	return float32(math.Sqrt(float64(this.X*this.X + this.Y*this.Y)))
}

/////////////////////////////////////
///		GO <-> C<commit_msg>removed length and scale from vector<commit_after>// Copyright (c) 2012 krepa098 (<EMAIL>)
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose, including commercial applications,
// and to alter it and redistribute it freely, subject to the following restrictions:
// 	1.	The origin of this software must not be misrepresented; you must not claim that you wrote the original software.
//			If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
// 	2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
// 	3. This notice may not be removed or altered from any source distribution.

package gosfml2

// #include <SFML/System.h>
// int getSizeVector2i() { return sizeof(sfVector2i); }
// int getSizeVector2u() { return sizeof(sfVector2u); }
// int getSizeVector2f() { return sizeof(sfVector2f); }
// int getSizeVector3f() { return sizeof(sfVector3f); }
import "C"

/////////////////////////////////////
///		STRUCTS
/////////////////////////////////////

type Vector2i struct {
	X, Y int
}

type Vector2u struct {
	X, Y uint
}

type Vector2f struct {
	X, Y float32
}

type Vector3f struct {
	X, Y, Z float32
}

/////////////////////////////////////
///		FUNCS
/////////////////////////////////////

/////////////////////////////////////
// Vector2i

// Returns the sum of two vectors.
func (this Vector2i) Plus(other Vector2i) Vector2i {
	return Vector2i{X: this.X + other.X, Y: this.Y + other.Y}
}

// Returns the difference of two vectors.
func (this Vector2i) Minus(other Vector2i) Vector2i {
	return Vector2i{X: this.X - other.X, Y: this.Y - other.Y}
}

/////////////////////////////////////
// Vector2u

// Returns the sum of two vectors.
func (this Vector2u) Plus(other Vector2u) Vector2u {
	return Vector2u{X: this.X + other.X, Y: this.Y + other.Y}
}

// Returns the difference of two vectors.
func (this Vector2u) Minus(other Vector2u) Vector2u {
	return Vector2u{X: this.X - other.X, Y: this.Y - other.Y}
}

/////////////////////////////////////
// Vector2f

// Returns the sum of two vectors.
func (this Vector2f) Plus(other Vector2f) Vector2f {
	return Vector2f{X: this.X + other.X, Y: this.Y + other.Y}
}

// Returns the difference of two vectors.
func (this Vector2f) Minus(other Vector2f) Vector2f {
	return Vector2f{X: this.X - other.X, Y: this.Y - other.Y}
}

/////////////////////////////////////
///		GO <-> C
{'fraction_non_alphanumeric': 0.19279047312520114, 'fraction_numerical': 0.02301255230125523, 'mean_word_length': 2.428019856591285, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, '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': '6011614', 'n_tokens_mistral': 1950, 'n_tokens_neox': 1894, 'n_words': 718}