예제 #1
0
 public Vector3D ProjectSelfOnto(Vector3D b)
 {
     return ScalarProjectionOnto(b) * this.ToUnitVector();
 }
예제 #2
0
 public double ScalarProjectionOnto(Vector3D b)
 {
     return Dot(this, b) / b.Magnitude();
 }
예제 #3
0
 public double Dot(Vector3D b)
 {
     return X * b.X + Y * b.Y + Z * b.Z;
 }
예제 #4
0
 /// <summary>
 /// Gets the angle of this object relative to the absolute X+ axis
 /// The angle returned is in radians.
 /// </summary>
 public float GetAngleBetween(Vector3D v)
 {
     return (float)Math.Acos((this.Dot(v)) / (this.Magnitude() * v.Magnitude()));
 }
예제 #5
0
 public Vector3D Cross(Vector3D b)
 {
     return new Vector3D(Y * b.Z - Z * b.Y, Z * b.X - X * b.Z, X * b.Y - Y * b.X);
 }
예제 #6
0
 /// <summary>
 /// Calls Vector2D.Distance(this, b)
 /// Returns distance between two vectors, when they are treated as points
 /// </summary>
 public double Distance(Vector3D b)
 {
     return Vector3D.Distance(this, b);
 }
예제 #7
0
 public static double Dot(Vector3D a, Vector3D b)
 {
     return a.Dot(b);
 }
예제 #8
0
 /// <summary>
 /// Treats the two vectors as points, and finds the distance between them.
 /// </summary>
 public static double Distance(Vector3D a, Vector3D b)
 {
     return new Vector3D(a.X - b.X, a.Y - b.Y, a.Z - b.Z).Magnitude();
 }
예제 #9
0
 public static Vector3D Cross(Vector3D a, Vector3D b)
 {
     return a.Cross(b);
 }
예제 #10
0
 public Ray3D(Point3D position, Vector3D direction)
 {
     this.position = position;
      this.direction = direction;
 }
예제 #11
0
 public Line3D(Point3D p, Vector3D v)
     : base(ShapeType3D.Line)
 {
     m_p = p;
      m_v = v;
 }