Ejemplo n.º 1
0
        public bool CollidesWith(LinearParameter2D param)
        {
            double t = (param.A.X * (B.Y - param.B.Y) - param.A.Y * (B.Y - param.B.X)) / (A.X * param.A.Y - param.A.X * A.Y);
            double s = (A.X * (B.Y - param.B.Y) - A.Y * (B.X - param.B.X)) / (A.X * param.A.Y - param.A.X * A.Y);

            return(s == t);
        }
Ejemplo n.º 2
0
 public Location2D ProjectToLine(LinearParameter2D lp)
 {
     return(lp.Point(0) + lp.DirectionVector().Project((new Vector2D(this, lp.Point(0)))));
 }
Ejemplo n.º 3
0
 public Location2F ProjectToLine(LinearParameter2D lp)
 {
     return((Location2F)lp.Point(0) + (Vector2F)lp.DirectionVector().Project((new Vector2F(this, (Location2F)lp.Point(0)))));
 }