mult() public method

public mult ( double a ) : Vec
a double
return Vec
示例#1
0
文件: Line.cs 项目: Arhirat/Relative
        override public void draw(DrawInfo di, Object selected)
        {
            Pen pen = new Pen(mColor);

            if (this == selected)
            {
                pen = new Pen(Color.Blue);
            }

            di.drawEllipse(pen,
                           mParent.getScreenFromWorld(mPos0), 10, 10);
            di.drawEllipse(pen,
                           mParent.getScreenFromWorld(mPos1), 10, 10);
            di.drawLine(pen,
                        mParent.getScreenFromWorld(mPos0),
                        mParent.getScreenFromWorld(mPos1));
            for (int i = 0; i < mSeg - 1; i++)
            {
                double alpha = (double)(i + 1) / (mSeg);
                Vec    pos   = mPos0.mult(alpha).plus(mPos1.mult(1 - alpha));
                di.drawEllipse(pen, mParent.getScreenFromWorld(pos), 5, 5);
            }
        }
示例#2
0
 public Vec mult(Vec pos)
 {
     return(mAxisX.mult(pos.mX).plus(mAxisY.mult(pos.mY)));
 }