Ejemplo n.º 1
0
 /// <summary>
 /// Returns signed angle
 /// </summary>
 /// <param name="v">The fromVector3D to calculate the signed angle to </param>
 /// <param name="about">The vector around which to rotate to get the correct sign</param>
 public Angle SignedAngleTo(Vector3D v, UnitVector3D about)
 {
     return(this.SignedAngleTo(v.Normalize(), about));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// The nearest angle between the vectors
 /// </summary>
 /// <param name="v">The other vector</param>
 /// <returns>The angle</returns>
 public Angle AngleTo(Vector3D v)
 {
     return(this.AngleTo(v.Normalize()));
 }
Ejemplo n.º 3
0
        public bool IsParallelTo(Vector3D othervector, Angle angleTolerance)
        {
            var other = othervector.Normalize();

            return(this.IsParallelTo(other, angleTolerance));
        }
Ejemplo n.º 4
0
        public bool IsPerpendicularTo(Vector3D othervector, double tolerance = 1e-10)
        {
            var other = othervector.Normalize();

            return(Math.Abs(this.DotProduct(other)) < tolerance);
        }
Ejemplo n.º 5
0
        public bool IsParallelTo(Vector3D othervector, double tolerance = 1e-10)
        {
            var other = othervector.Normalize();

            return(this.IsParallelTo(other, tolerance));
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Ray3D"/> struct.
 /// </summary>
 /// <param name="throughPoint">The start point of the ray.</param>
 /// <param name="direction">A vector indicating the direction of the ray.</param>
 public Ray3D(Point3D throughPoint, Vector3D direction)
     : this(throughPoint, direction.Normalize())
 {
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Creates a coordinate system that rotates
 /// </summary>
 /// <param name="angle">Angle to rotate</param>
 /// <param name="v">Vector to rotate about</param>
 /// <returns></returns>
 public static CoordinateSystem Rotation(Angle angle, Vector3D v)
 {
     return(Rotation(angle, v.Normalize()));
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Creates a coordinate system that rotates
 /// </summary>
 /// <param name="a">Angle to rotate</param>
 /// <param name="unit">The unit of the angle</param>
 /// <param name="v">Vector to rotate about</param>
 /// <returns></returns>
 public static CoordinateSystem Rotation <T>(double a, T unit, Vector3D v) where T : IAngleUnit
 {
     return(Rotation(Angle.From(a, unit), v.Normalize()));
 }
Ejemplo n.º 9
0
 public CoordinateSystem RotateCoordSysAroundVector <T>(Vector3D aboutVector3D, double angle, T angleUnit)
     where T : IAngleUnit
 {
     return(this.RotateCoordSysAroundVector(aboutVector3D.Normalize(), Angle.From(angle, angleUnit)));
 }