public static double GetDistance(Diem3D diem1, Diem3D diem2) { var v1 = new Vecto3D(diem1); var v2 = new Vecto3D(diem2); return((v2 - v1).Getlength()); }
public static Vecto3D operator -(Vecto3D v1, Vecto3D v2) { var v = new Vecto3D(); v.x = v1.x - v2.x; v.y = v1.y - v2.y; v.z = v1.z - v2.z; return(v); }
Program() { var a = new Vecto3D(2, -1, 3); var b = new Vecto3D(1, 2, 4); Console.WriteLine("Tich co huong a va b la: "); (a / b).print(); var c = new Vecto3D(5, 2, -3); var d = new Vecto3D(4, 5, -6); double volume = ( (b - a) * ((c - a) / (d - a)) ); Console.WriteLine("the tich: " + volume); }
public static Vecto3D Bisection(Vecto3D v1, Vecto3D v2) { return((v1 * v2.Getlength()) + (v2 * v1.Getlength())); }
public static double Angle(Vecto3D v1, Vecto3D v2) { return(Math.Acos((v1 * v2) / (v1.Getlength() * v2.Getlength()))); }