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))); }
public override double Distance(Point2d p) { return(Math.Abs(center.Distance(p) - radius)); }
public Circle2d(double xcenter, double ycenter, double radius) { this.center = new Point2d(xcenter, ycenter); this.radius = radius; }
public Circle2d(Circle2d tocopy) { center = tocopy.center; radius = tocopy.radius; }
public Parabola2d(Parabola2d tocopy) { vertex = tocopy.vertex; rotation = tocopy.rotation; a = tocopy.a; }
public Circle2d(Point2d center, double radius) { this.center = center; this.radius = radius; }
public override double Distance(Point2d p) { return(ClosestPoint(p).Distance(p)); }
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)); }
public override Point2d ClosestPoint(Point2d from) { return(from.ClosestPoint(Perpendicular(from))); }
public void Append(Point2d p) { Append(p.X, p.Y); }
public bool Contains(Point2d p) { return(Contains(p.X, p.Y)); }