示例#1
0
 public override Line Cut(Line L, Point reference)
 {
     Point P = IntersectionPoint(L);
     if(P==null) return null;
     bool IsRefAtLeft = new Vector(P, reference) * L.Director.Normal > 0;
     bool IsOriginAtLeft = L.Director.Normal * new Vector(P,Origin)  > 0;
     if (IsRefAtLeft == IsOriginAtLeft)
         return new LineSegment(P,Origin);
     if ((new Vector(P, reference) * L.Director.Normal) * (L.Director.Normal * new Vector(P, Origin)) == 0)
         return this;
     return new LineSegment(P, B);
 }
示例#2
0
文件: Vector.cs 项目: Supitto/Metria
 public Vector(Vector V)
     : base(V)
 {
 }
示例#3
0
文件: Ray.cs 项目: Supitto/Metria
 public Ray(Point P, Vector V)
     : base(P, V)
 {
 }
示例#4
0
文件: Line.cs 项目: Supitto/Metria
 public Line(Line L)
 {
     _origin = new Point(L.Origin);
     Director = new Vector(L.Director);
 }
示例#5
0
文件: Line.cs 项目: Supitto/Metria
 public Line(Point P, Point Q)
 {
     _origin = new Point(P);
     Director = new Vector(P,Q);
 }
示例#6
0
文件: Line.cs 项目: Supitto/Metria
 public Line(Point P, Vector V)
 {
     _origin = new Point(P);
     Director = new Vector(V);
 }
示例#7
0
 public LineSegment(Point A, Vector V)
     : base(A, V)
 {
 }