/// <summary> /// Produces a vector perpendicular to the current vector and the input vector /// </summary> /// <param name="v">The input vector</param> /// <returns>A new perpendicular R3Vector</returns> public R3Vector cross(R3Vector v) { return(new R3Vector( y * v.z - z * v.y, z * v.x - x * v.z, x * v.y - y * v.x)); }
public float dot(R3Vector v) { return(x * v.x + y * v.y + z * v.z); }
public R3Vector add(R3Vector v) { return(new R3Vector(x + v.x, y + v.y, z + v.z)); }