/// <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));
 }
 /// <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()));
 }
        public bool IsParallelTo(Vector3D othervector, Angle angleTolerance)
        {
            var other = othervector.Normalize();

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

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

            return(this.IsParallelTo(other, tolerance));
        }
Exemple #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())
 {
 }
Exemple #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()));
 }
Exemple #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()));
 }
Exemple #9
0
 public CoordinateSystem RotateCoordSysAroundVector <T>(Vector3D aboutVector3D, double angle, T angleUnit)
     where T : IAngleUnit
 {
     return(this.RotateCoordSysAroundVector(aboutVector3D.Normalize(), Angle.From(angle, angleUnit)));
 }