iTextSharp.text.pdf.parser.Vector.Subtract C# (CSharp) Method

Subtract() public method

public Subtract ( Vector v ) : Vector
v Vector
return Vector
        public Vector Subtract(Vector v)
        {
            float x = vals[I1] - v.vals[I1];
            float y = vals[I2] - v.vals[I2];
            float z = vals[I3] - v.vals[I3];

            return new Vector(x, y, z);
        }

Usage Example

コード例 #1
0
            public TextChunk(String str, Vector startLocation, Vector endLocation, float charSpaceWidth)
            {
                this.text           = str;
                this.startLocation  = startLocation;
                this.endLocation    = endLocation;
                this.charSpaceWidth = charSpaceWidth;

                Vector oVector = endLocation.Subtract(startLocation);

                if (oVector.Length == 0)
                {
                    oVector = new Vector(1, 0, 0);
                }
                orientationVector    = oVector.Normalize();
                orientationMagnitude = (int)(Math.Atan2(orientationVector[Vector.I2], orientationVector[Vector.I1]) * 1000);

                // see http://mathworld.wolfram.com/Point-LineDistance2-Dimensional.html
                // the two vectors we are crossing are in the same plane, so the result will be purely
                // in the z-axis (out of plane) direction, so we just take the I3 component of the result
                Vector origin = new Vector(0, 0, 1);

                distPerpendicular = (int)(startLocation.Subtract(origin)).Cross(orientationVector)[Vector.I3];

                distParallelStart = orientationVector.Dot(startLocation);
                distParallelEnd   = orientationVector.Dot(endLocation);
            }
All Usage Examples Of iTextSharp.text.pdf.parser.Vector::Subtract