public double DotProduct(AdnVector v) { return ((X * v.X) + (Y * v.Y) + (Z * v.Z)); }
public AdnVector Substract(AdnVector v) { return new AdnVector(X - v.X, Y - v.Y, Z - v.Z); }
public AdnVector CrossProduct(AdnVector v) { return new AdnVector( (Y * v.Z) - (Z * v.Y), (Z * v.X) - (X * v.Z), (X * v.Y) - (Y * v.X)); }
public AdnVector Add(AdnVector v) { return new AdnVector(v.X + X, v.Y + Y, v.Z + Z); }
public AdnVector(AdnVector v) { X = v.X; Y = v.Y; Z = v.Z; }
public AdnRay(AdnPoint origin, AdnVector direction) { Origin = origin; Direction = direction; Direction.Normalize(); }
public AdnQuaternion(AdnVector axis, double degrees) { // First we want to convert the degrees to radians // since the angle is assumed to be in radians double angle = (degrees / 180.0) * Math.PI; // Here we calculate the sin( theta / 2) once for optimization double result = Math.Sin(angle * 0.5); // Calcualte the w value by cos( theta / 2 ) _w = Math.Cos(angle * 0.5); // Calculate the x, y and z of the quaternion _x = axis.X * result; _y = axis.Y * result; _z = axis.Z * result; }