Пример #1
0
 public double DotProduct(AdnVector v)
 {
     return ((X * v.X) + (Y * v.Y) + (Z * v.Z));
 }
Пример #2
0
 public AdnVector Substract(AdnVector v)
 {
     return new AdnVector(X - v.X, Y - v.Y, Z - v.Z);
 }
Пример #3
0
 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));
 }
Пример #4
0
 public AdnVector Add(AdnVector v)
 {
     return new AdnVector(v.X + X, v.Y + Y, v.Z + Z);
 }
Пример #5
0
 public AdnVector(AdnVector v)
 {
     X = v.X;
     Y = v.Y;
     Z = v.Z;
 }
Пример #6
0
        public AdnRay(AdnPoint origin, AdnVector direction)
        {
            Origin = origin;

            Direction = direction;

            Direction.Normalize();
        }
Пример #7
0
        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;
        }