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)));
 }