예제 #1
0
        public static Circle2d From2Points(Point2d p1, Point2d p2)
        {
            Point2d center = new Point2d((p1.X + p2.X) / 2.0, (p1.Y + p2.Y) / 2.0);

            return(new Circle2d(center, center.Distance(p1)));
        }
예제 #2
0
 public override double Distance(Point2d p)
 {
     return(Math.Abs(center.Distance(p) - radius));
 }
예제 #3
0
 public Circle2d(double xcenter, double ycenter, double radius)
 {
     this.center = new Point2d(xcenter, ycenter);
     this.radius = radius;
 }
예제 #4
0
 public Circle2d(Circle2d tocopy)
 {
     center = tocopy.center;
     radius = tocopy.radius;
 }
예제 #5
0
 public Parabola2d(Parabola2d tocopy)
 {
     vertex   = tocopy.vertex;
     rotation = tocopy.rotation;
     a        = tocopy.a;
 }
예제 #6
0
 public Circle2d(Point2d center, double radius)
 {
     this.center = center;
     this.radius = radius;
 }
예제 #7
0
 public override double Distance(Point2d p)
 {
     return(ClosestPoint(p).Distance(p));
 }
예제 #8
0
 public override double PositionOf(Point2d pnt)
 {
     //parameter is same as parameter on line in angle of parabola
     return(new Line2d(vertex, vertex + Vector2d.FromAngle(rotation)).PositionOf(pnt));
 }
예제 #9
0
 public override Point2d ClosestPoint(Point2d from)
 {
     return(from.ClosestPoint(Perpendicular(from)));
 }
예제 #10
0
파일: Box2d.cs 프로젝트: ventor3000/guppy2
 public void Append(Point2d p)
 {
     Append(p.X, p.Y);
 }
예제 #11
0
파일: Box2d.cs 프로젝트: ventor3000/guppy2
 public bool Contains(Point2d p)
 {
     return(Contains(p.X, p.Y));
 }