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); }
public Location2D ProjectToLine(LinearParameter2D lp) { return(lp.Point(0) + lp.DirectionVector().Project((new Vector2D(this, lp.Point(0))))); }
public Location2F ProjectToLine(LinearParameter2D lp) { return((Location2F)lp.Point(0) + (Vector2F)lp.DirectionVector().Project((new Vector2F(this, (Location2F)lp.Point(0))))); }