示例#1
0
        /// <summary>
        /// returns the distance beteween the two vectors. Will always be positive.Same as minus(v).mag().

        /// </summary>
        /// <param name="v"></param>
        /// <returns></returns>
        // Useful Functions
        public double dist(JJVector v)
        {
            var dx = mX - v.x();
            var dy = mY - v.y();

            return(Math.Sqrt(dx * dx + dy * dy));
        }
示例#2
0
        public JJVector plus(JJVector v, JJVector result)
        {
            result.set(mX + v.x(), mY + v.y(), mT + v.t());

            return(result);
        }
示例#3
0
 public JJVector minus(JJVector v, JJVector result)
 {
     result.set(mX - v.x(), mY - v.y(), mT - v.t());
     return(result);
 }
示例#4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="v"></param>
 /// <returns>returns this . v, i.e. the dot product of this and v.</returns>
 public double dot(JJVector v) => mX *v.x() + mY * v.y();