2024-03-27 13:30:13 +04:00
|
|
|
|
namespace ProjectLiner
|
2024-03-14 16:09:51 +04:00
|
|
|
|
{
|
|
|
|
|
public class Vector2
|
|
|
|
|
{
|
|
|
|
|
public float x, y;
|
|
|
|
|
public float lenght => MathF.Sqrt(x * x + y * y);
|
|
|
|
|
public Vector2 normilized => new Vector2(x/lenght, y/lenght);
|
|
|
|
|
public Vector2(float x, float y)
|
|
|
|
|
{
|
|
|
|
|
this.x = x;
|
|
|
|
|
this.y = y;
|
|
|
|
|
}
|
|
|
|
|
public Vector2()
|
|
|
|
|
{
|
|
|
|
|
x = 0;
|
|
|
|
|
y = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|