public float distanceTo(Vector3f p) { Vector3f plane = new Vector3f(a, b, c); float d = (p * plane + this.d) / plane.length(); return(d); }
public Vector3f computeTrajectory(Vector3f vector) { float len = vector.length(); Vector3f newTrajectory = vector.copy(); float projection = (vector * normal) / (normal * normal); Vector3f u = normal * projection; newTrajectory.subtract(u).subtract(u); newTrajectory.stretch(friction); //Console.Out.WriteLine("Got: " + vector.ToString() + " computed: " + newTrajectory.ToString()); return newTrajectory; }
public float length(Vector3f dst) { Vector3f delta = new Vector3f(x - dst.x, y - dst.y, z - dst.z); return(delta.length()); }
public float length(Vector3f dst) { Vector3f delta = new Vector3f(x - dst.x, y - dst.y, z - dst.z); return delta.length(); }
public float distanceTo(Vector3f p) { Vector3f plane = new Vector3f(a, b, c); float d = (p * plane + this.d) / plane.length(); return d; }