Пример #1
0
 /// <summary>
 /// Rotate vector
 /// </summary>
 public Vector3d Rotate(Rotation r)
 {
     if (this._coord != r.Coord)
     {
         r = r.ConvertTo(this._coord);
     }
     return(r.ToRotationMatrix * this);
 }
Пример #2
0
        /// <summary>
        /// Determines whether two objects are equal.
        /// </summary>
        public override bool Equals(object obj)
        {
            if (obj == null || (!object.ReferenceEquals(this.GetType(), obj.GetType())))
            {
                return(false);
            }
            Rotation r = (Rotation)obj;

            if (GeometRi3D.UseAbsoluteTolerance)
            {
                return((this.ToRotationMatrix - r.ConvertTo(this.Coord).ToRotationMatrix).MaxNorm < GeometRi3D.Tolerance);
            }
            else
            {
                return((this.ToRotationMatrix - r.ConvertTo(this.Coord).ToRotationMatrix).MaxNorm / this.ToRotationMatrix.MaxNorm < GeometRi3D.Tolerance);
            }
        }
Пример #3
0
 /// <summary>
 /// Rotate point around point 'p' as a rotation center.
 /// </summary>
 public Point3d Rotate(Rotation r, Point3d p)
 {
     if (this._coord != r.Coord)
     {
         r = r.ConvertTo(this._coord);
     }
     if (this._coord != p.Coord)
     {
         p = p.ConvertTo(this._coord);
     }
     return(r.ToRotationMatrix * (this - p) + p);
 }
Пример #4
0
        /// <summary>
        /// Combine two rotations.
        /// </summary>
        public Rotation Mult(Rotation r)
        {
            Matrix3d m = this.ToRotationMatrix * r.ConvertTo(this.Coord).ToRotationMatrix;

            return(new Rotation(m, this.Coord));
        }