public class Vector3D
{
public float x, y, z;
public Vector3D(float x=0f,float y=0f,float z=0f){
this.x = x;
this.y = y;
this.z = z;}
public Vector3D add(Vector3D vec){
Vector3D ret = new Vector3D(x, y, z);
ret.x += ret.x;
ret.y += ret.y;
ret.z += ret.z;return ret;}
public Vector3D sub(Vector3D vec){
Vector3D ret = new Vector3D(x, y, z);
ret.x -= vec.x;
ret.y -= vec.y;
ret.z -= vec.z;return ret;}
public Vector3D corss(Vector3D vec){
Vector3D ret = new Vector3D();
ret.x = y * vec.z - z * vec.y;
ret.y = z * vec.x - x * vec.z;
ret.z = x * vec.y - y * vec.x;return ret;}
public voidnormalize(){float length =(float)System.Math.Sqrt(x * x + y * y + z * z);
x /= length;
y /= length;
z /= length;}
public override string ToString(){return string.Format("("+ x +","+ y +","+ z +")");}
public static Vector3D operator +(Vector3D lv,Vector3D rv){return lv.add(rv);}
public static Vector3D operator -(Vector3D lv,Vector3D rv){return lv.sub(rv);}}