title: Java Vector3d And Vector Logic
body: <p>First of all I am having trouble with the concept of a mathematical Vector when being applied to a Vector3d. I understand a vector to be just like a line except it has a direction property.</p>
  
  <p>Now, Vector3d only takes in 3 arguments (x,y,z) in its constructor. I assumed this to be because the vector initially is assumed to start at the origin and go through the designated point. How can we ever have a vector which does not intersect the origin if the only attributes contained in Vector3d are x,y,z?</p>
  
  <p>For example, I am trying to program a function which calculates the distance between two points on a sphere:</p>
  
  <pre><code>    //Returns the shortest distance between two points on a sphere
  public static double getGreatCircleDistance(Point3d p1, Point3d p2){
      Vector3d v1 = getVector(viewSphereOrigin, p1);
      Vector3d v2 = getVector(viewSphereOrigin, p2);
      v1.normalize();
      v2.normalize();
      return Math.acos(v1.dot(v2)*(viewSphereDiameter/2));
  }
  
  //Returns a vector through two given Points in 3d space
  public static Vector3d getVector(Point3d start, Point3d terminal){
      return new Vector3d(terminal.x-start.x, terminal.y-start.y, terminal.z-start.z);
  }
  </code></pre>
  
  <p>I do not understand however how getVector() can return a vector which passes through the two given points. I researched how to obtain a vector connecting two points:</p>
  
  <p><a href="http://emweb.unl.edu/math/mathweb/vectors/vectors.html#vec6" rel="nofollow">http://emweb.unl.edu/math/mathweb/vectors/vectors.html#vec6</a></p>
  
  <p>however fundamentally I still do not understand this. Can someone clear up the logic behind Vector3d for me please and how it can represent an arbitrary vector in 3D space yet it only contains x,y,z?</p>
  
  <p>Thanks!</p>