using System;
using System.Drawing;

namespace Super2d3dGraphLibrary;

internal class vector
{
	private float _x;

	private float _y;

	private float _z;

	public float x
	{
		get
		{
			return _x;
		}
		set
		{
			_x = x;
		}
	}

	public float y
	{
		get
		{
			return _y;
		}
		set
		{
			_y = y;
		}
	}

	public float z
	{
		get
		{
			return _z;
		}
		set
		{
			_z = z;
		}
	}

	public vector(float x, float y, float z)
	{
		_x = x;
		_y = y;
		_z = z;
	}

	public PointF toPointF()
	{
		return new PointF(_x, _y);
	}

	public static vector operator -(vector v1, vector v2)
	{
		return new vector(v1.x - v2.x, v1.y - v2.y, v1.z - v2.z);
	}

	public static vector operator *(vector v1, vector v2)
	{
		return new vector(v1.y * v2.z - v1.z * v2.y, v2.x * v1.z - v2.z * v1.x, v1.x * v2.y - v1.y * v2.x);
	}

	public vector Norm()
	{
		float num = (float)Math.Sqrt(_x * _x + _y * _y + _z * _z);
		return new vector(_x / num, _y / num, _z / num);
	}
}
