Пример #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;
 }