There are m points on the line (set by the user), you need to find a point from which the distance to the rest would be minimal.

How do I display points on the screen in C ++ Builder?

Closed due to the fact that the issue is too general for participants user207618, cheops , Kirill Stoianov , αλεχολυτ , Streletz 23 Sep '16 at 0:12 .

Please correct the question so that it describes the specific problem with sufficient detail to determine the appropriate answer. Do not ask a few questions at once. See “How to ask a good question?” For clarification. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • "distance to others" is what language? - Igor

2 answers 2

You can do this: Form1->Canvas->Pixels[x][y] = clWhite ; /*0xFFFFFF*/ Form1->Canvas->Pixels[x][y] = clWhite ; /*0xFFFFFF*/

     void __fastcall TForm1::FormMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y) { //параметры Form1->Canvas->Pen->Color = clBlue; Form1->Canvas->Pen->Width = 5; Form1->Canvas->Brush->Color = clRed; // отрисовка Form1->Canvas->MoveTo(X, Y); // Переходит к координатам Form1->Canvas->LineTo(X, Y); // Рисует точечку } 
    • Why on the canvas, and not in CHART? - BuilderC
    • @Builder for the chart, no one asked. And if you want to display 10,000,000 points, then your chart will hang - you need opengl, but I don’t write why the answer is not opengl. But you can publish your solution as an answer. - nick_n_a
    • @BuilderC because there is no CHART in the task. Well, as answered above choke. - Alex.B