示例#1
0
        /// <summary>Computes the cross product of this vector and the specified vector</summary>
        /// <param name="with">the vector to cross this vector with</param>
        /// <returns>the cross product</returns>
        public virtual iText.Kernel.Geom.Vector Cross(iText.Kernel.Geom.Vector with)
        {
            float x = vals[I2] * with.vals[I3] - vals[I3] * with.vals[I2];
            float y = vals[I3] * with.vals[I1] - vals[I1] * with.vals[I3];
            float z = vals[I1] * with.vals[I2] - vals[I2] * with.vals[I1];

            return(new iText.Kernel.Geom.Vector(x, y, z));
        }
示例#2
0
        /// <summary>Computes the difference between this vector and the specified vector</summary>
        /// <param name="v">the vector to subtract from this one</param>
        /// <returns>the results of the subtraction</returns>
        public virtual iText.Kernel.Geom.Vector Subtract(iText.Kernel.Geom.Vector v)
        {
            float x = vals[I1] - v.vals[I1];
            float y = vals[I2] - v.vals[I2];
            float z = vals[I3] - v.vals[I3];

            return(new iText.Kernel.Geom.Vector(x, y, z));
        }
示例#3
0
 /// <seealso cref="System.Object.Equals(System.Object)"/>
 public override bool Equals(Object obj)
 {
     if (this == obj)
     {
         return(true);
     }
     if (obj == null)
     {
         return(false);
     }
     if (GetType() != obj.GetType())
     {
         return(false);
     }
     iText.Kernel.Geom.Vector other = (iText.Kernel.Geom.Vector)obj;
     if (!iText.IO.Util.JavaUtil.ArraysEquals(vals, other.vals))
     {
         return(false);
     }
     return(true);
 }
示例#4
0
 /// <summary>Computes the dot product of this vector with the specified vector</summary>
 /// <param name="with">the vector to dot product this vector with</param>
 /// <returns>the dot product</returns>
 public virtual float Dot(iText.Kernel.Geom.Vector with)
 {
     return(vals[I1] * with.vals[I1] + vals[I2] * with.vals[I2] + vals[I3] * with.vals[I3]);
 }