Lined up circle, n points

39

11

Draw lines between every pair of distinct points for n points arranged in a circle, producing something like the below result. Shortest code (in bytes) wins! Your lines don't have to be transparent, but it looks better that way. The output must be a vector graphic, or be an image at least 600 pixels by 600 pixels (either saved to a file or displayed on the screen). To complete the challenge you must draw at least 20.

enter image description here

J. Antonio Perez

Posted 2016-12-01T17:43:25.683

Reputation: 1 480

7It'd be cool if you had to take in a number n and draw lines for n points. – Yodle – 2016-12-01T17:45:30.337

2I second this idea. Change it before someone gets the first answer. – shooqie – 2016-12-01T17:53:14.667

2@shooqie Then the title wouldn't make sense though, unless that can be edited by the mods? – Yodle – 2016-12-01T17:54:33.863

1Or you can make a new one – shooqie – 2016-12-01T17:55:05.670

Actually looks like anyone can edit the title, should I propose that as a change or leave it as is? – Yodle – 2016-12-01T17:56:49.747

I mean, it's up to the submitter what he will do. You should propose it as a change though. – shooqie – 2016-12-01T17:58:15.740

2I don't think changing 37 to an arbitrary n would add much to the challenge as I expect most solutions to work with any number anyway, especially because 37 is odd and hence there are no mirror symmetries. – Laikoni – 2016-12-01T18:01:00.773

@Laikoni Well I figured it'd be interesting to see different patterns by changing the number, but I guess you could just use other people's solutions and change the 37 to whatever you want yourself. – Yodle – 2016-12-01T18:04:48.310

Your sample output is not a vector graphic; it's a JPEG raster graphic. – Glenn Randers-Pehrson – 2016-12-01T18:12:30.850

1@GlennRanders-Pehrson "or be an image at least 600 pixels by 600 pixels" – trichoplax – 2016-12-01T18:14:51.737

3Do we take n as input or just pick an arbitrary n over 20? – Rɪᴋᴇʀ – 2016-12-01T18:16:03.223

What is the minimum permitted radius of the circle, as a fraction of the image size? – trichoplax – 2016-12-01T18:17:19.687

Somewhat related. – Martin Ender – 2016-12-01T18:42:20.587

At least 80%? I mean... why is that concern? – J. Antonio Perez – 2016-12-01T18:44:36.773

What n did you use for your example? – Titus – 2016-12-01T22:35:38.823

@Titus 37, it was the initial challenge (check the question's revision history for more details) – Rod – 2016-12-02T10:52:29.780

Do we have to parametrize? Please clarify with for a given n (and rephrase or remove the last sentence) or with for n>=20 of your choice or explicitly allow both. Thanks. – Titus – 2016-12-02T12:01:43.673

For people interested in the mathematics behind this specific graph, check out this link on complete graphs.

– Jeel Shah – 2016-12-02T17:49:30.907

Answers

26

Mathematica, 13 bytes

CompleteGraph

lined-up-circle-37-points

Looks like this only fails to give a circular embedding for n=4, but the question states n>=20

ngenisis

Posted 2016-12-01T17:43:25.683

Reputation: 4 600

1...and there was me trying to find the correct way to make a function to take n (I had the answer ready from the fixed 37) :( – Jonathan Allan – 2016-12-01T18:23:17.550

Why is that a built in?! That language is crazy good at graphing. – Magic Octopus Urn – 2016-12-01T18:40:40.650

6

@carusocomputing This function has nothing to do with "graphing" in the sense of plotting. Mathematica is also very good for graph theory problems and having a built-in to generate a complete graph seems like the first thing I would add if I added support for graphs to my language. The only reason this function happens to be useful for this challenge is that complete graphs are by default rendered with all vertices arranged in a circle.

– Martin Ender – 2016-12-01T18:46:25.640

2If you're gonna support graphs, you better have a built in complete graph function, IMO. – ngenisis – 2016-12-01T18:47:19.950

2@carusocomputing Welcome to Mathematica, the language that has a built-in for every existing function. :-P – HyperNeutrino – 2016-12-02T01:47:27.610

1I was downloading NetLogo because I thought "multi-turtle will make short work of this!" then remembered you Mathematicans are using the grown-up version. – wyldstallyns – 2016-12-02T15:48:17.007

13

MATL, 16 14 bytes

As I'm not terribly fluent with MATL I expect that this is somewhat more golfable. (Would be nice to at least beat Mathematica :-) I.e. the the flip w is not optimal, it could probably be avoided...

:G/4*Jw^2Z^!XG

Test it Online! (Thanks @Suever for this service, thanks @DrMcMoylex for -2 bytes.)

Explanation (for N=3):

  :               Generate Range 1:input:       [1,2,3]
   G/             Divide By the first input     [0.333,0.666,1]
     4*           Multiply by 4                 [1.33,2.66,4.0]
       Jw^        i ^ (the result so far)       [-0.49+ 0.86i,-.5-0.86i,1.00]
                  (This results in a list of the n-th roots of unity)
          2Z^     Take the cartesian product with itself (i.e. generate all 2-tuples of those points)
             !XG  Transpose and plot

It is worth noting that for generating the N-th roots of unity you can use the formula exp(2*pi*i*k/N) for k=1,2,3,...,N. But since exp(pi*i/2) = i you could also write i^(4*k/N) for k=1,2,3,...,N which is what I'm doing here.

flawr

Posted 2016-12-01T17:43:25.683

Reputation: 40 560

1You can change XH:H to :G – James – 2016-12-01T22:08:25.567

1Aaah I forgot about G thank you very much! – flawr – 2016-12-01T22:10:10.507

11

PICO-8, 131 bytes

I wasn't really sure if I'd be breaking any rules, but I did it anyway!

Golfed

p={}for i=0,19 do add(p,{64+64*cos(i/20),64+64*sin(i/20)})end for x in all(p)do for y in all(p)do line(x[1],x[2],y[1],y[2])end end

Ungolfed

points={}

for i=0,19 do 
  x=64+64*cos(i/20)
  y=64+64*sin(i/20)
  add(points,{x,y})
end

for x in all(points) do
  for y in all(points) do
    line(x[1],x[2],y[1],y[2])
  end
end

128x128 madness

PICO-8 is a Lua based fantasy console with a native resolution of 128x128. I made the circle as big as I could...

Tyler MacDonell

Posted 2016-12-01T17:43:25.683

Reputation: 701

9

Mathematica, 42 bytes

Creates a set of 37 points arranged in a circle, and then draws lines between all possible subsets of two points. Someone posted a shorter answer that takes advantage of CompleteGraph, but I believe this is the shortest one aside from those relying on CompleteGraph.

Graphics@Line@Subsets[CirclePoints@37,{2}]

enter image description here

J. Antonio Perez

Posted 2016-12-01T17:43:25.683

Reputation: 1 480

3There's no need to avoid drawing lines from a point to itself, so you could save 3 bytes by using Tuple. You also need to update this to accept arbitrary n, but conveniently that won't cost you any bytes. – ngenisis – 2016-12-01T19:45:38.063

1Meant to say Tuples – ngenisis – 2016-12-01T20:30:30.833

9

HTML + JS (ES6), 34 + 177 164 162 = 196 bytes

Using the HTML5 Canvas API.

See it on CodePen.

f=n=>{with(Math)with(c.getContext`2d`)for(translate(S=300,S),O=n;O--;)for(rotate(a=PI*2/n),N=n;N--;)beginPath(stroke()),lineTo(0,S),lineTo(sin(a*N)*S,cos(a*N)*S)}


/* Demo */
f(20)
<canvas id=c width=600 height=600>

-13 bytes: Removed closePath(), moved stroke() inside beginPath()

-2 bytes: Defined variable a inside rotate()

darrylyeo

Posted 2016-12-01T17:43:25.683

Reputation: 6 214

8

Java, 346 338 322 301 Bytes

This solution works for all n>1, even though the original post didn't require that, it does.

My favorite is n=5, don't ask why, also, if you want a cooler GUI, use:

int a=Math.min(this.getHeight(),this.getWidth())/2;

In place of the hard-coded 300, it'll use the width or height of the frame as the diameter.

Saved 8 bytes thanks to Shooqie. Saved 21 bytes thanks to Geobits.

import java.awt.*;void m(final int n){new Frame(){public void paint(Graphics g){Point[]p=new Point[n];int a=300;for(int i=1;i<n+1;i++){p[i-1]=new Point(a+(int)(a*Math.cos(i*2*Math.PI/n)),a+(int)(a*Math.sin(i*2*Math.PI/n)));for(int j=0;j<i;j++){g.drawLine(p[i-1].x,p[i-1].y,p[j].x,p[j].y);}}}}.show();}

Output for n=37:

enter image description here

Magic Octopus Urn

Posted 2016-12-01T17:43:25.683

Reputation: 19 422

You can drop Frame x= and final (I think?) – shooqie – 2016-12-01T18:26:03.113

@shooqie oops, Frame x was from another solution that involved a thread. You need the final though as it's an internal class reference to an external variable in the owning class. – Magic Octopus Urn – 2016-12-01T18:27:28.453

It works just fine on my machine. BTW I think you can shave off some bytes by moving int declarations outside the for loops – shooqie – 2016-12-01T18:29:03.270

@shooqie in Java 6 it's saying "Cannot refer to the non-final local variable n in an enclosing scope" at compile time. – Magic Octopus Urn – 2016-12-01T18:34:05.543

It worked for me on Java 8, but after you edited your post I'm only getting white screen. – shooqie – 2016-12-01T18:36:32.497

@shooqie fixed, made a dumb mistake. – Magic Octopus Urn – 2016-12-01T18:41:39.257

All right, it still works for me without the final keyword, IDE only gives me a warning that show() is deprecated. – shooqie – 2016-12-01T18:44:50.613

I'm having a problem getting this to work. When run as-is, it just gives me a tiny window, too small to actually show anything (or even the border-buttons like close/maximize). – Geobits – 2016-12-01T20:47:41.300

When I expand the window, it show this: http://imgur.com/a/cl9oW Any ideas?

– Geobits – 2016-12-01T20:53:37.627

@Geobits yeah, I made a change that didn't pan out haha. Fixed. – Magic Octopus Urn – 2016-12-01T21:02:55.640

You can also drop the Panel entirely and rearrange some stuff to save quite a bit: import java.awt.*;void g(int n){new Frame(){public void paint(Graphics g){Point[]p=new Point[n];double f;for(int a=300,i=1,j;i<=n;i++){p[i-1]=new Point(a+(int)(a*Math.cos(f=i*2*Math.PI/n)),a+(int)(a*Math.sin(f)));for(j=0;j<i;)g.drawLine(p[i-1].x,p[i-1].y,p[j].x,p[j++].y);}}}.show();} – Geobits – 2016-12-01T21:16:07.127

(for Java 6 add that final back in I guess) – Geobits – 2016-12-01T21:17:25.877

@geobits there's some other stuff in there that's not Java 6 friendly. If you want to use my answer and make a Java 8 answer that beats this, feel free :). – Magic Octopus Urn – 2016-12-01T21:31:41.220

Huh, really? I think all I did (beside final) was drop the panel and rearrange variables. It works on my Java 6 as long as I add the final back in. – Geobits – 2016-12-01T21:39:56.167

Please also post the ungolfed code so we can actually read it... – smci – 2016-12-04T12:19:19.733

7

Python 2, 258 235 229 Bytes

import itertools as T,math as M
from PIL import Image as I,ImageDraw as D
s=300
n=input()
t=2*M.pi/n
o=I.new('RGB',(s*2,)*2)
for x in T.combinations([(s*M.cos(t*i)+s,s*M.sin(t*i)+s)for i in range(n)],2):D.Draw(o).line(x)
o.show()

Output for n=37
n=37

Rod

Posted 2016-12-01T17:43:25.683

Reputation: 17 588

1Wouldn't be from PIL import* shorter? – Roman Gräf – 2016-12-02T19:57:06.483

@RomanGräf PIL is a weird package, you can't import *, depending on how you install, you could skip the PIL and import Image/ImageDraw directly – Rod – 2016-12-05T10:38:06.043

6

Octave, 88 69 bytes

N=input('');t=0:2*pi/N:N;k=nchoosek(1:N,2)';line(cos(t)(k),sin(t)(k))

Output for N=37:

enter image description here

Output for N=19:

enter image description here

Stewie Griffin

Posted 2016-12-01T17:43:25.683

Reputation: 43 471

Oh, I didn't even notice that there was already another Octave answer:) – flawr – 2016-12-01T21:31:01.320

Anyway, beat ya :-)

– flawr – 2016-12-01T22:21:15.967

By a mile! My first thought was gplot too, but I didn't manage to make it short enough... – Stewie Griffin – 2016-12-02T09:05:53.543

6

Perl, 229 bytes

It uses the same formula as most languages that don't have convenient builtin for this challenge (even if I didn't look at them to find it, but that's a fairly easy to find formula). So not very interesting, but there are usually not a lot of Perl answers to this kind of challenges, so I just wanted to propose one.

$i=new Imager xsize=>700,ysize=>700;for$x(1..$_){for$y(1..$_){$i->line(color=>red,x1=>350+300*cos($a=2*pi*$x/$_),x2=>350+300*cos($b=2*pi*$y/$_),y1=>350+300*sin$a,y2=>350+300*sin$b)}}$i->write(file=>"t.png")

And you'll need -MImager (9 bytes), -MMath::Trig (providing pi, 13 bytes), and -n (1 byte) ==> + 23 bytes.

To run it :

perl -MImager -MMath::Trig -ne '$i=new Imager xsize=>700,ysize=>700;for$x(1..$_){for$y(1..$_){$i->line(color=>red,x1=>350+300*cos($a=2*pi*$x/$_),x2=>350+300*cos($b=2*pi*$y/$_),y1=>350+300*sin$a,y2=>350+300*sin$b)}}$i->write(file=>"t.png")' <<< 27

It will create a file named t.png which contains the image.

You'll need to install Imager though, but no worries, it's quite easy :

(echo y;echo) | perl -MCPAN -e 'install Imager'

(The echos will configure you cpan if you've never used it before. (actually that will only work if your perl is recent enough, I think for most of you it will be, and I'm sorry for the others!)).

And the more readable version (yes, it's fairly readable for a Perl script!) :

#!/usr/bin/perl -n
use Imager;
use Math::Trig;
$i=Imager->new(xsize=>700,ysize=>700);
for $x (1..$_){
    for $y (1..$_){
    $i->line(color=>red,x1=>350+300*cos($a=2*pi*$x/$_), x2=>350+300*cos($b=2*pi*$y/$_),
         y1=>350+300*sin($a), y2=>350+300*sin($b));
    }
}
$i->write(file=>"t.png");

enter image description here

-1 byte thanks to Titus.

Dada

Posted 2016-12-01T17:43:25.683

Reputation: 8 279

Does Perl require braces around single commands? – Titus – 2016-12-04T13:07:39.430

@Titus If you refer to the braces after the for loops, then yes, they are mandatory. – Dada – 2016-12-04T19:10:57.550

There´s a blank before y2. I bet you don´t need that. And can you write to STDOUT? – Titus – 2016-12-05T23:19:23.127

@Titus hmm indeed, thanks. I think I my terminal put a newline here so i didn't saw the space. – Dada – 2016-12-05T23:23:32.993

5

GeoGebra, 92 bytes

a=polygon((0,0),(1,0),20)
sequence(sequence(segment(vertex(a,i),vertex(a,j)),j,1,20),i,1,20)

Each line is separately entered into the input bar. Here is a gif showing the execution:

Execution

How it works

The polygon command creates a 20-sided polygon, with the vertices of the baseline at (0,0) and (1,0). The next command then iterates over each vertex of the polygon with index i, using the sequence and vertex commands, and for each vertex with index i, draws a line segment to every other vertex with index j using the segment command.

TheBikingViking

Posted 2016-12-01T17:43:25.683

Reputation: 3 674

4

PHP, 186 184 196 bytes

imagecolorallocate($i=imagecreate(601,601),~0,~0,~0);for(;$a<$p=2*M_PI;)for($b=$a+=$p/=$argv[1];$b>0;)imageline($i,(1+cos($a))*$r=300,$r+$r*sin($a),$r+$r*cos($b-=$p),$r+$r*sin($b),1);imagepng($i);

writes the image to STDOUT

breakdown

// create image with white background
imagecolorallocate($i=imagecreate(601,601),~0,~0,~0);

// loop angle A from 0 to 2*PI
for(;$a<$p=2*M_PI;)
    // loop angle B from A down to 0
    for($b=$a+=$p/=$argv[1];$b;)    // ($a pre-increment)
        // draw black line from A to B
        imageline($i,                           // draw line
            (1+cos($a))*$r=300,$r+$r*sin($a),   // from A
            $r+$r*cos($b-=$p),$r+$r*sin($b),    // to B ($b pre-decrement)
            1                                   // undefined color=black
        );
// output
imagepng($i);

-12 bytes for fixed n=20

Replace $p=2*M_PI with 6 (-8), /=$argv[1] with =M_PI/10 (-2), and $b>0 with $b (-2)

Using exact PI/10 doesn´t hurt. With .3142, the rounding errors from the parametrized version remained, but with M_PI/10 they vanished and I can check $b(<>0) instead of $b>0. I could have saved two bytes with .314, but that would have off-set the points.

The limit $a<6 is sufficiently exact for 20 points.

exact PI graph

174 bytes for fixed n=314

imagecolorallocate($i=imagecreate(601,601),~0,~0,~0);for(;$a<314;)for($b=$a++;$b--;)imageline($i,(1+cos($a))*$r=300,$r+$r*sin($a),$r+$r*cos($b),$r+$r*sin($b),1);imagepng($i);

Using 314 points results in a filled circle in that resolution (as do 136,140, every even number above that, and everything above 317).

Titus

Posted 2016-12-01T17:43:25.683

Reputation: 13 814

1Good answer, but it seems you've hardcoded 20 instead of taking that as input? – Riking – 2016-12-01T23:09:39.533

1@Riking: True. But I can see no demand in the challenge for parametrizing it. – Titus – 2016-12-02T11:41:36.310

4

R, 127 123 bytes

plot((e=cbind(sin(t<-seq(0,2*pi,l=(n=21)))*2,cos(t)*2)));for(i in 2:n)for(j in 1:i)lines(c(e[i,1],e[j,1]),c(e[i,2],e[j,2]))

Produces :

Nice axis' labels uh ?

-4 bytes thanks to @Titus !

Frédéric

Posted 2016-12-01T17:43:25.683

Reputation: 2 059

1Not shorter, but it could be faster with for(i in 2:n){for(j in 1:i)...}. Does Rrequire the braces? – Titus – 2016-12-04T13:05:04.550

@Titus You're right ! And no, no braces needed there. Thanks ! – Frédéric – 2016-12-18T13:18:58.717

4

NetLogo - 44 bytes

cro 20[create-links-to other turtles fd 20]

NetLogo output

wyldstallyns

Posted 2016-12-01T17:43:25.683

Reputation: 401

3

Octave, 50 48 46 45 bytes

@(N)gplot((k=0:2*pi/N:N)+k',[cos(k);sin(k)]')

This is an anyonmous function that plots the graph we're looking for.

Explanation:

(k=0:2*pi/N:N)+k' Makes a full N+1 x N+1 adjecency matrix and simultaneously defines the vector k of angles, which we we use then for [cos(k);sin(k)]', a matrix of coordinates where each graph node is positioned. gplot just plots the graph that we want.

For N = 29 we get:

enter image description here

flawr

Posted 2016-12-01T17:43:25.683

Reputation: 40 560

3

BBC BASIC, 98 ascii characters

Tokenised filesize 86 bytes

r=600V.5142;29,r;r;:I.n:t=2*PI/n:F.i=1TOn*n:a=i DIVn*t:b=i MODn*t:L.r*SINa,r*COSa,r*SINb,r*COSb:N.

Dowload interpreter at http://www.bbcbasic.co.uk/bbcwin/bbcwin.html

There's nothing wrong with drawing every line twice, the appearance is identical :-P

Ungolfed

  r=600                              :REM Radius 600 units. 2 units per pixel, so 300 pixels
  VDU5142;29,r;r;                    :REM Set mode 20 (600 pixels high) and move origin away from screen corner
  INPUTn                             :REM Take input.
  t=2*PI/n                           :REM Step size in radians.
  FORi=1TOn*n                        :REM Iterate through all combinations.
    a=i DIVn*t                       :REM Get two angles a and b
    b=i MODn*t                       :REM by integer division and modlo
    LINEr*SINa,r*COSa,r*SINb,r*COSb  :REM calculate cartesian coordinates and draw line
  NEXT

Output n=21

This looks much better in the original rendering than in the browser.

<code>enter image description here</code>

Level River St

Posted 2016-12-01T17:43:25.683

Reputation: 22 049

Thanks for reminding me of the LINE function. Beats DRAW... – steenbergh – 2016-12-01T22:04:57.077

2

MATLAB, 36 bytes

@(n)plot(graph(ones(n),'Om'),'La','c')

This is an anoymous function that creates the plot.

@(n)                                     Define an anonymous fuction of 
               ones(n)                   Create an × matrix of ones
         graph(       ,'Om')             Create a graph object with that adjacency
                                         matrix, omitting self-loops
    plot(                   ,'La','c')   Plot the graph with a circular layout

Example:

enter image description here

enter image description here

Luis Mendo

Posted 2016-12-01T17:43:25.683

Reputation: 87 464

I'm surprised graph is not part of the bioinformatic toolbox... didn't even know it existed... Nice :) – Stewie Griffin – 2016-12-02T13:08:01.337

2

JavaScript (ES5)/SVG (HTML5), 181 bytes

document.write('<svg viewBox=-1e3,-1e3,2e3,2e3><path stroke=#000 fill=none d=M1e3,0')
with(Math)for(i=37;--i;)for(j=37;j--;)document.write('L'+1e3*cos(a=i*j*PI*2/37)+','+1e3*sin(a))

Only works for prime numbers, such as the original suggestion of 37. You can halve (rounded up) the initial value of i to obtain a fainter image. You can also consistently adjust the 1e3,2e3 to other values to taste (I started with 300,600 but decided that it was too coarse).

Neil

Posted 2016-12-01T17:43:25.683

Reputation: 95 035

1

QBasic 4.5, 398 271 bytes

CLS:SCREEN 11:DEFSTR M-Z:DEFDBL A-L
INPUT"N",A:I=(360/A)*.0175:J=230
Q=",":FOR E=0 TO A
FOR F=E TO A
M=x$(COS(I*E)*J+J):N=x$(SIN(I*E)*J+J):O=x$(COS(I*F)*J+J):P=x$(SIN(I*F)*J+J):DRAW "BM"+M+Q+N+"M"+O+Q+P
NEXT:NEXT
FUNCTION x$(d):x$=LTRIM$(STR$(CINT(d))):END FUNCTION

The screen in QBasic can onl be 640x480, so the circle has a radius of only 230 px, unfortunately. Also, there's some artifacting because of float-to-int precision loss. Looks like this for N=36: enter image description here

EDIT: I didn't need the storage, the type declaration and all the looping. Calculating all Carthesians from Polars in place is 50% cheaper in byte count...

steenbergh

Posted 2016-12-01T17:43:25.683

Reputation: 7 772

1

QBIC, 98 94 bytes

$SCREEN 11|:i=6.3/a j=230[0,a|[b,a|line(cos(b*i)*j+j,sin(b*i)*j+j)-(cos(c*i)*j+j,sin(c*o)*j+j)

I've converted my original QBasic answer @LevelRiverSt 's answer to QBIC. I thought this would rely too heavily on functions that are not built into QBIC to be feasible, but as it turns out, it saves another 90 bytes. Substituting the DRAW for LINE saves another 80 bytes. I knew I was forgetting something simple...

When run with a command line parameter of 36, it looks like this:

enter image description here

steenbergh

Posted 2016-12-01T17:43:25.683

Reputation: 7 772

1

Processing, 274 bytes (239 + size call and function call)

void d(int s){float a=2*PI/s,x=0,y=-400,m,n;float[][]p=new float[2][s];translate(400,400);for(int i=0;i<s;i++){m=x*cos(a)-y*sin(a);n=x*sin(a)+y*cos(a);x=m;y=n;p[0][i]=x;p[1][i]=y;for(int j=0;j<i;j++)line(p[0][j],p[1][j],p[0][i],p[1][i]);}}
void setup(){size(800,800);d(50);}

I honestly don't know why, but setup had to be on the second line. I used https://en.wikipedia.org/wiki/Rotation_matrix to help me calculate the maths for rotation. This program calculates the points and pushes them to an array, with which we are using to draw lines.

Here is a picture of a polygon with 50 edges (the 100 edges one was almost completely black)

50 points

You can add stroke(0,alpha); to have transparent edges, where alpha is the opacity of the line. Here's the same polygon with alpha of 20.

enter image description here

user41805

Posted 2016-12-01T17:43:25.683

Reputation: 16 320

1

Bash + Jelly + GraphViz, 52 characters, 52 or 63 bytes

Given that the programs in question disagree on which character encoding to use, the program is full of control characters. Here's what it looks like under xxd, in Latin-1 encoding (which represents each character in one byte):

00000000: 6a65 6c6c 7920 6520 2793 5213 636a 0c8e  jelly e '.R.cj..
00000010: 2d2d 59fe 9a3f 1d15 dc65 34d3 8442 7f05  --Y..?...e4..B..
00000020: 1172 80cf fb3b ff7d 277c 6369 7263 6f20  .r...;.}'|circo 
00000030: 2d54 7073                                -Tps

I couldn't actually get the program to run, though, without converting the input into UTF-8 for some reason (which would make it 63 bytes long). Logically it should work as Latin-1 – none of the characters are outside the range 0 to 255 – but I keep getting "string index out of range" errors no matter how I configure the character encoding environment variables. So this will have to be counted as 63 bytes unless someone can figure out a way to run it without re-encoding it.

The program might be slightly more readable if we interpret it in Jelly's encoding:

jelly e 'ƓRŒcj€⁾--Y“Ȥ?øßṇe4ạ⁴B¶¦×r°Ẇ»;”}'|circo -Tps

The program takes the number of points on standard input and outputs a PostScript image on standard output. (It can trivially be adapted to output in any format GraphViz supports by changing the -Tps at the end; it's just that PostScript has the shortest name. Arguably, you can save five characters by removing the -Tps, but then you get output in GraphViz's internal image format that nothing else supports, which probably doesn't count for the purposes of the question.)

Fundamentally, this is just a Jelly program that calls into GraphViz to do the drawing; however, Jelly doesn't seem to have any capabilities for running external programs, so I had to use bash to link them together. (This also means that it's cheaper to make Jelly request input from stdin manually; normally it takes input from the command line, but that would mean extra bytes in the bash wrapper.) circo will automatically arrange all the points it's asked to draw in a circle, so the Jelly code just has to ask it to draw a list of points, all of which are connected to each other. Here's how it works:

ƓRŒcj€⁾--Y“Ȥ?øßṇe4ạ⁴B¶¦×r°Ẇ»;”}
Ɠ                               read number from stdin
 R                              produce range from 1 to that number
                                (here used to produce a list with
                                that many distinct elements)
  Œc                            select all unordered pairs from that
      ⁾--                       a string consisting of two hyphens
    j€                          join each pair via the string
         Y                      join on newlines
                            ;   prepend (in this context)
          “Ȥ?øßṇe4ạ⁴B¶¦×r°Ẇ»    "graph{node[shape=point]"
                             ”} follow output with a "}" character

The use of Jelly lets us slightly compress the string that configures the GraphViz output via its built-in dictionary. The dictionary has graph, node, and point. Annoyingly, it doesn't have shape (it has SHAPE, but GraphViz is case-sensitive), so we have to encode that character-by-character.

Here's the output for input 21 (with a slight modification to the program to make it output in a format that can be uploaded to Stack Exchange):

complete graph on 21 points

user62131

Posted 2016-12-01T17:43:25.683

Reputation:

0

PHP + HTML SVG, 316 263 bytes

Golfed version with hardcoded n points and no input n parameter:

<svg height="610" width="610"><?for($i=1;$i<33;$i++){$x[]=300*sin(2*M_PI/32*$i)+305;$y[]=300*cos(2*M_PI/32)+305;}foreach($x as$j=>$w){foreach($y as$k=>$z){echo'<line x1="'.$x[$j].'" y1="'.$y[$j].'" x2="'.$x[$k].'" y2="'.$y[$k].'" style="stroke:red;"/>';}}?></svg>

Previous golfed version with input parameter for n points, 316 bytes:

<svg height="610" width="610"><?$n=$_GET[n];$d=2*M_PI/$n;$r=300;$o=305;for($i=1;$i<=$n;$i++){$x[]=$r*sin($d*$i)+$o;$y[]=$r*cos($d*$i)+$o;}foreach($x as$j=>$w){foreach($y as$k=>$z){echo'<line x1="'.$x[$j].'" y1="'.$y[$j].'" x2="'.$x[$k].'" y2="'.$y[$k].'" style="stroke:rgba(0,0,0,.15);stroke-width:1;" />';}}?></svg>

Usage: save in a file and call from the browser:

http://localhost/codegolf/circle.php?n=32

Ungolfed version with input parameter for n points and CSS:

<style>
line {
    stroke: rgba(0,0,0,.15);
    stroke-width:1;
}
</style>
<svg height="610" width="610">
<?php
$n=$_GET[n]; // number of points
$d=2*M_PI/$n; // circle parts
$r=300; // circle radius
$o=305; // offset x,y
for ($i=1;$i<=$n;$i++){
    $x[]=$r*sin($d*$i)+$o; // store x,y coordinates in array
    $y[]=$r*cos($d*$i)+$o;
}
foreach($x as $j => $w){ // iterate all x,y points and connect to each other
    foreach($y as $k => $z) {
        echo '<line x1="'.$x[$j].'" y1="'.$y[$j].'" x2="'.$x[$k].'" y2="'.$y[$k].'" />'."\n";   
    }
}
?>
</svg>

Couldn't attach a 32 points fully functional snippet because of the 30k characters limit for a single post. Here is a screenshot:

enter image description here

The attached snippet is limited to 18 points because of the 30k single post limit.

line {
stroke: rgba(0,0,0,.15);
stroke-width:1;
}
<svg height="610" width="610">
<line x1="407.6060429977" y1="586.90778623577" x2="407.6060429977" y2="586.90778623577" />
<line x1="407.6060429977" y1="586.90778623577" x2="497.83628290596" y2="534.81333293569" />
<line x1="407.6060429977" y1="586.90778623577" x2="564.80762113533" y2="455" />
<line x1="407.6060429977" y1="586.90778623577" x2="600.44232590366" y2="357.09445330008" />
<line x1="407.6060429977" y1="586.90778623577" x2="600.44232590366" y2="252.90554669992" />
<line x1="407.6060429977" y1="586.90778623577" x2="564.80762113533" y2="155" />
<line x1="407.6060429977" y1="586.90778623577" x2="497.83628290596" y2="75.186667064307" />
<line x1="407.6060429977" y1="586.90778623577" x2="407.6060429977" y2="23.092213764227" />
<line x1="407.6060429977" y1="586.90778623577" x2="305" y2="5" />
<line x1="407.6060429977" y1="586.90778623577" x2="202.3939570023" y2="23.092213764227" />
<line x1="407.6060429977" y1="586.90778623577" x2="112.16371709404" y2="75.186667064307" />
<line x1="407.6060429977" y1="586.90778623577" x2="45.192378864669" y2="155" />
<line x1="407.6060429977" y1="586.90778623577" x2="9.5576740963376" y2="252.90554669992" />
<line x1="407.6060429977" y1="586.90778623577" x2="9.5576740963376" y2="357.09445330008" />
<line x1="407.6060429977" y1="586.90778623577" x2="45.192378864668" y2="455" />
<line x1="407.6060429977" y1="586.90778623577" x2="112.16371709404" y2="534.81333293569" />
<line x1="407.6060429977" y1="586.90778623577" x2="202.3939570023" y2="586.90778623577" />
<line x1="407.6060429977" y1="586.90778623577" x2="305" y2="605" />
<line x1="497.83628290596" y1="534.81333293569" x2="407.6060429977" y2="586.90778623577" />
<line x1="497.83628290596" y1="534.81333293569" x2="497.83628290596" y2="534.81333293569" />
<line x1="497.83628290596" y1="534.81333293569" x2="564.80762113533" y2="455" />
<line x1="497.83628290596" y1="534.81333293569" x2="600.44232590366" y2="357.09445330008" />
<line x1="497.83628290596" y1="534.81333293569" x2="600.44232590366" y2="252.90554669992" />
<line x1="497.83628290596" y1="534.81333293569" x2="564.80762113533" y2="155" />
<line x1="497.83628290596" y1="534.81333293569" x2="497.83628290596" y2="75.186667064307" />
<line x1="497.83628290596" y1="534.81333293569" x2="407.6060429977" y2="23.092213764227" />
<line x1="497.83628290596" y1="534.81333293569" x2="305" y2="5" />
<line x1="497.83628290596" y1="534.81333293569" x2="202.3939570023" y2="23.092213764227" />
<line x1="497.83628290596" y1="534.81333293569" x2="112.16371709404" y2="75.186667064307" />
<line x1="497.83628290596" y1="534.81333293569" x2="45.192378864669" y2="155" />
<line x1="497.83628290596" y1="534.81333293569" x2="9.5576740963376" y2="252.90554669992" />
<line x1="497.83628290596" y1="534.81333293569" x2="9.5576740963376" y2="357.09445330008" />
<line x1="497.83628290596" y1="534.81333293569" x2="45.192378864668" y2="455" />
<line x1="497.83628290596" y1="534.81333293569" x2="112.16371709404" y2="534.81333293569" />
<line x1="497.83628290596" y1="534.81333293569" x2="202.3939570023" y2="586.90778623577" />
<line x1="497.83628290596" y1="534.81333293569" x2="305" y2="605" />
<line x1="564.80762113533" y1="455" x2="407.6060429977" y2="586.90778623577" />
<line x1="564.80762113533" y1="455" x2="497.83628290596" y2="534.81333293569" />
<line x1="564.80762113533" y1="455" x2="564.80762113533" y2="455" />
<line x1="564.80762113533" y1="455" x2="600.44232590366" y2="357.09445330008" />
<line x1="564.80762113533" y1="455" x2="600.44232590366" y2="252.90554669992" />
<line x1="564.80762113533" y1="455" x2="564.80762113533" y2="155" />
<line x1="564.80762113533" y1="455" x2="497.83628290596" y2="75.186667064307" />
<line x1="564.80762113533" y1="455" x2="407.6060429977" y2="23.092213764227" />
<line x1="564.80762113533" y1="455" x2="305" y2="5" />
<line x1="564.80762113533" y1="455" x2="202.3939570023" y2="23.092213764227" />
<line x1="564.80762113533" y1="455" x2="112.16371709404" y2="75.186667064307" />
<line x1="564.80762113533" y1="455" x2="45.192378864669" y2="155" />
<line x1="564.80762113533" y1="455" x2="9.5576740963376" y2="252.90554669992" />
<line x1="564.80762113533" y1="455" x2="9.5576740963376" y2="357.09445330008" />
<line x1="564.80762113533" y1="455" x2="45.192378864668" y2="455" />
<line x1="564.80762113533" y1="455" x2="112.16371709404" y2="534.81333293569" />
<line x1="564.80762113533" y1="455" x2="202.3939570023" y2="586.90778623577" />
<line x1="564.80762113533" y1="455" x2="305" y2="605" />
<line x1="600.44232590366" y1="357.09445330008" x2="407.6060429977" y2="586.90778623577" />
<line x1="600.44232590366" y1="357.09445330008" x2="497.83628290596" y2="534.81333293569" />
<line x1="600.44232590366" y1="357.09445330008" x2="564.80762113533" y2="455" />
<line x1="600.44232590366" y1="357.09445330008" x2="600.44232590366" y2="357.09445330008" />
<line x1="600.44232590366" y1="357.09445330008" x2="600.44232590366" y2="252.90554669992" />
<line x1="600.44232590366" y1="357.09445330008" x2="564.80762113533" y2="155" />
<line x1="600.44232590366" y1="357.09445330008" x2="497.83628290596" y2="75.186667064307" />
<line x1="600.44232590366" y1="357.09445330008" x2="407.6060429977" y2="23.092213764227" />
<line x1="600.44232590366" y1="357.09445330008" x2="305" y2="5" />
<line x1="600.44232590366" y1="357.09445330008" x2="202.3939570023" y2="23.092213764227" />
<line x1="600.44232590366" y1="357.09445330008" x2="112.16371709404" y2="75.186667064307" />
<line x1="600.44232590366" y1="357.09445330008" x2="45.192378864669" y2="155" />
<line x1="600.44232590366" y1="357.09445330008" x2="9.5576740963376" y2="252.90554669992" />
<line x1="600.44232590366" y1="357.09445330008" x2="9.5576740963376" y2="357.09445330008" />
<line x1="600.44232590366" y1="357.09445330008" x2="45.192378864668" y2="455" />
<line x1="600.44232590366" y1="357.09445330008" x2="112.16371709404" y2="534.81333293569" />
<line x1="600.44232590366" y1="357.09445330008" x2="202.3939570023" y2="586.90778623577" />
<line x1="600.44232590366" y1="357.09445330008" x2="305" y2="605" />
<line x1="600.44232590366" y1="252.90554669992" x2="407.6060429977" y2="586.90778623577" />
<line x1="600.44232590366" y1="252.90554669992" x2="497.83628290596" y2="534.81333293569" />
<line x1="600.44232590366" y1="252.90554669992" x2="564.80762113533" y2="455" />
<line x1="600.44232590366" y1="252.90554669992" x2="600.44232590366" y2="357.09445330008" />
<line x1="600.44232590366" y1="252.90554669992" x2="600.44232590366" y2="252.90554669992" />
<line x1="600.44232590366" y1="252.90554669992" x2="564.80762113533" y2="155" />
<line x1="600.44232590366" y1="252.90554669992" x2="497.83628290596" y2="75.186667064307" />
<line x1="600.44232590366" y1="252.90554669992" x2="407.6060429977" y2="23.092213764227" />
<line x1="600.44232590366" y1="252.90554669992" x2="305" y2="5" />
<line x1="600.44232590366" y1="252.90554669992" x2="202.3939570023" y2="23.092213764227" />
<line x1="600.44232590366" y1="252.90554669992" x2="112.16371709404" y2="75.186667064307" />
<line x1="600.44232590366" y1="252.90554669992" x2="45.192378864669" y2="155" />
<line x1="600.44232590366" y1="252.90554669992" x2="9.5576740963376" y2="252.90554669992" />
<line x1="600.44232590366" y1="252.90554669992" x2="9.5576740963376" y2="357.09445330008" />
<line x1="600.44232590366" y1="252.90554669992" x2="45.192378864668" y2="455" />
<line x1="600.44232590366" y1="252.90554669992" x2="112.16371709404" y2="534.81333293569" />
<line x1="600.44232590366" y1="252.90554669992" x2="202.3939570023" y2="586.90778623577" />
<line x1="600.44232590366" y1="252.90554669992" x2="305" y2="605" />
<line x1="564.80762113533" y1="155" x2="407.6060429977" y2="586.90778623577" />
<line x1="564.80762113533" y1="155" x2="497.83628290596" y2="534.81333293569" />
<line x1="564.80762113533" y1="155" x2="564.80762113533" y2="455" />
<line x1="564.80762113533" y1="155" x2="600.44232590366" y2="357.09445330008" />
<line x1="564.80762113533" y1="155" x2="600.44232590366" y2="252.90554669992" />
<line x1="564.80762113533" y1="155" x2="564.80762113533" y2="155" />
<line x1="564.80762113533" y1="155" x2="497.83628290596" y2="75.186667064307" />
<line x1="564.80762113533" y1="155" x2="407.6060429977" y2="23.092213764227" />
<line x1="564.80762113533" y1="155" x2="305" y2="5" />
<line x1="564.80762113533" y1="155" x2="202.3939570023" y2="23.092213764227" />
<line x1="564.80762113533" y1="155" x2="112.16371709404" y2="75.186667064307" />
<line x1="564.80762113533" y1="155" x2="45.192378864669" y2="155" />
<line x1="564.80762113533" y1="155" x2="9.5576740963376" y2="252.90554669992" />
<line x1="564.80762113533" y1="155" x2="9.5576740963376" y2="357.09445330008" />
<line x1="564.80762113533" y1="155" x2="45.192378864668" y2="455" />
<line x1="564.80762113533" y1="155" x2="112.16371709404" y2="534.81333293569" />
<line x1="564.80762113533" y1="155" x2="202.3939570023" y2="586.90778623577" />
<line x1="564.80762113533" y1="155" x2="305" y2="605" />
<line x1="497.83628290596" y1="75.186667064307" x2="407.6060429977" y2="586.90778623577" />
<line x1="497.83628290596" y1="75.186667064307" x2="497.83628290596" y2="534.81333293569" />
<line x1="497.83628290596" y1="75.186667064307" x2="564.80762113533" y2="455" />
<line x1="497.83628290596" y1="75.186667064307" x2="600.44232590366" y2="357.09445330008" />
<line x1="497.83628290596" y1="75.186667064307" x2="600.44232590366" y2="252.90554669992" />
<line x1="497.83628290596" y1="75.186667064307" x2="564.80762113533" y2="155" />
<line x1="497.83628290596" y1="75.186667064307" x2="497.83628290596" y2="75.186667064307" />
<line x1="497.83628290596" y1="75.186667064307" x2="407.6060429977" y2="23.092213764227" />
<line x1="497.83628290596" y1="75.186667064307" x2="305" y2="5" />
<line x1="497.83628290596" y1="75.186667064307" x2="202.3939570023" y2="23.092213764227" />
<line x1="497.83628290596" y1="75.186667064307" x2="112.16371709404" y2="75.186667064307" />
<line x1="497.83628290596" y1="75.186667064307" x2="45.192378864669" y2="155" />
<line x1="497.83628290596" y1="75.186667064307" x2="9.5576740963376" y2="252.90554669992" />
<line x1="497.83628290596" y1="75.186667064307" x2="9.5576740963376" y2="357.09445330008" />
<line x1="497.83628290596" y1="75.186667064307" x2="45.192378864668" y2="455" />
<line x1="497.83628290596" y1="75.186667064307" x2="112.16371709404" y2="534.81333293569" />
<line x1="497.83628290596" y1="75.186667064307" x2="202.3939570023" y2="586.90778623577" />
<line x1="497.83628290596" y1="75.186667064307" x2="305" y2="605" />
<line x1="407.6060429977" y1="23.092213764227" x2="407.6060429977" y2="586.90778623577" />
<line x1="407.6060429977" y1="23.092213764227" x2="497.83628290596" y2="534.81333293569" />
<line x1="407.6060429977" y1="23.092213764227" x2="564.80762113533" y2="455" />
<line x1="407.6060429977" y1="23.092213764227" x2="600.44232590366" y2="357.09445330008" />
<line x1="407.6060429977" y1="23.092213764227" x2="600.44232590366" y2="252.90554669992" />
<line x1="407.6060429977" y1="23.092213764227" x2="564.80762113533" y2="155" />
<line x1="407.6060429977" y1="23.092213764227" x2="497.83628290596" y2="75.186667064307" />
<line x1="407.6060429977" y1="23.092213764227" x2="407.6060429977" y2="23.092213764227" />
<line x1="407.6060429977" y1="23.092213764227" x2="305" y2="5" />
<line x1="407.6060429977" y1="23.092213764227" x2="202.3939570023" y2="23.092213764227" />
<line x1="407.6060429977" y1="23.092213764227" x2="112.16371709404" y2="75.186667064307" />
<line x1="407.6060429977" y1="23.092213764227" x2="45.192378864669" y2="155" />
<line x1="407.6060429977" y1="23.092213764227" x2="9.5576740963376" y2="252.90554669992" />
<line x1="407.6060429977" y1="23.092213764227" x2="9.5576740963376" y2="357.09445330008" />
<line x1="407.6060429977" y1="23.092213764227" x2="45.192378864668" y2="455" />
<line x1="407.6060429977" y1="23.092213764227" x2="112.16371709404" y2="534.81333293569" />
<line x1="407.6060429977" y1="23.092213764227" x2="202.3939570023" y2="586.90778623577" />
<line x1="407.6060429977" y1="23.092213764227" x2="305" y2="605" />
<line x1="305" y1="5" x2="407.6060429977" y2="586.90778623577" />
<line x1="305" y1="5" x2="497.83628290596" y2="534.81333293569" />
<line x1="305" y1="5" x2="564.80762113533" y2="455" />
<line x1="305" y1="5" x2="600.44232590366" y2="357.09445330008" />
<line x1="305" y1="5" x2="600.44232590366" y2="252.90554669992" />
<line x1="305" y1="5" x2="564.80762113533" y2="155" />
<line x1="305" y1="5" x2="497.83628290596" y2="75.186667064307" />
<line x1="305" y1="5" x2="407.6060429977" y2="23.092213764227" />
<line x1="305" y1="5" x2="305" y2="5" />
<line x1="305" y1="5" x2="202.3939570023" y2="23.092213764227" />
<line x1="305" y1="5" x2="112.16371709404" y2="75.186667064307" />
<line x1="305" y1="5" x2="45.192378864669" y2="155" />
<line x1="305" y1="5" x2="9.5576740963376" y2="252.90554669992" />
<line x1="305" y1="5" x2="9.5576740963376" y2="357.09445330008" />
<line x1="305" y1="5" x2="45.192378864668" y2="455" />
<line x1="305" y1="5" x2="112.16371709404" y2="534.81333293569" />
<line x1="305" y1="5" x2="202.3939570023" y2="586.90778623577" />
<line x1="305" y1="5" x2="305" y2="605" />
<line x1="202.3939570023" y1="23.092213764227" x2="407.6060429977" y2="586.90778623577" />
<line x1="202.3939570023" y1="23.092213764227" x2="497.83628290596" y2="534.81333293569" />
<line x1="202.3939570023" y1="23.092213764227" x2="564.80762113533" y2="455" />
<line x1="202.3939570023" y1="23.092213764227" x2="600.44232590366" y2="357.09445330008" />
<line x1="202.3939570023" y1="23.092213764227" x2="600.44232590366" y2="252.90554669992" />
<line x1="202.3939570023" y1="23.092213764227" x2="564.80762113533" y2="155" />
<line x1="202.3939570023" y1="23.092213764227" x2="497.83628290596" y2="75.186667064307" />
<line x1="202.3939570023" y1="23.092213764227" x2="407.6060429977" y2="23.092213764227" />
<line x1="202.3939570023" y1="23.092213764227" x2="305" y2="5" />
<line x1="202.3939570023" y1="23.092213764227" x2="202.3939570023" y2="23.092213764227" />
<line x1="202.3939570023" y1="23.092213764227" x2="112.16371709404" y2="75.186667064307" />
<line x1="202.3939570023" y1="23.092213764227" x2="45.192378864669" y2="155" />
<line x1="202.3939570023" y1="23.092213764227" x2="9.5576740963376" y2="252.90554669992" />
<line x1="202.3939570023" y1="23.092213764227" x2="9.5576740963376" y2="357.09445330008" />
<line x1="202.3939570023" y1="23.092213764227" x2="45.192378864668" y2="455" />
<line x1="202.3939570023" y1="23.092213764227" x2="112.16371709404" y2="534.81333293569" />
<line x1="202.3939570023" y1="23.092213764227" x2="202.3939570023" y2="586.90778623577" />
<line x1="202.3939570023" y1="23.092213764227" x2="305" y2="605" />
<line x1="112.16371709404" y1="75.186667064307" x2="407.6060429977" y2="586.90778623577" />
<line x1="112.16371709404" y1="75.186667064307" x2="497.83628290596" y2="534.81333293569" />
<line x1="112.16371709404" y1="75.186667064307" x2="564.80762113533" y2="455" />
<line x1="112.16371709404" y1="75.186667064307" x2="600.44232590366" y2="357.09445330008" />
<line x1="112.16371709404" y1="75.186667064307" x2="600.44232590366" y2="252.90554669992" />
<line x1="112.16371709404" y1="75.186667064307" x2="564.80762113533" y2="155" />
<line x1="112.16371709404" y1="75.186667064307" x2="497.83628290596" y2="75.186667064307" />
<line x1="112.16371709404" y1="75.186667064307" x2="407.6060429977" y2="23.092213764227" />
<line x1="112.16371709404" y1="75.186667064307" x2="305" y2="5" />
<line x1="112.16371709404" y1="75.186667064307" x2="202.3939570023" y2="23.092213764227" />
<line x1="112.16371709404" y1="75.186667064307" x2="112.16371709404" y2="75.186667064307" />
<line x1="112.16371709404" y1="75.186667064307" x2="45.192378864669" y2="155" />
<line x1="112.16371709404" y1="75.186667064307" x2="9.5576740963376" y2="252.90554669992" />
<line x1="112.16371709404" y1="75.186667064307" x2="9.5576740963376" y2="357.09445330008" />
<line x1="112.16371709404" y1="75.186667064307" x2="45.192378864668" y2="455" />
<line x1="112.16371709404" y1="75.186667064307" x2="112.16371709404" y2="534.81333293569" />
<line x1="112.16371709404" y1="75.186667064307" x2="202.3939570023" y2="586.90778623577" />
<line x1="112.16371709404" y1="75.186667064307" x2="305" y2="605" />
<line x1="45.192378864669" y1="155" x2="407.6060429977" y2="586.90778623577" />
<line x1="45.192378864669" y1="155" x2="497.83628290596" y2="534.81333293569" />
<line x1="45.192378864669" y1="155" x2="564.80762113533" y2="455" />
<line x1="45.192378864669" y1="155" x2="600.44232590366" y2="357.09445330008" />
<line x1="45.192378864669" y1="155" x2="600.44232590366" y2="252.90554669992" />
<line x1="45.192378864669" y1="155" x2="564.80762113533" y2="155" />
<line x1="45.192378864669" y1="155" x2="497.83628290596" y2="75.186667064307" />
<line x1="45.192378864669" y1="155" x2="407.6060429977" y2="23.092213764227" />
<line x1="45.192378864669" y1="155" x2="305" y2="5" />
<line x1="45.192378864669" y1="155" x2="202.3939570023" y2="23.092213764227" />
<line x1="45.192378864669" y1="155" x2="112.16371709404" y2="75.186667064307" />
<line x1="45.192378864669" y1="155" x2="45.192378864669" y2="155" />
<line x1="45.192378864669" y1="155" x2="9.5576740963376" y2="252.90554669992" />
<line x1="45.192378864669" y1="155" x2="9.5576740963376" y2="357.09445330008" />
<line x1="45.192378864669" y1="155" x2="45.192378864668" y2="455" />
<line x1="45.192378864669" y1="155" x2="112.16371709404" y2="534.81333293569" />
<line x1="45.192378864669" y1="155" x2="202.3939570023" y2="586.90778623577" />
<line x1="45.192378864669" y1="155" x2="305" y2="605" />
<line x1="9.5576740963376" y1="252.90554669992" x2="407.6060429977" y2="586.90778623577" />
<line x1="9.5576740963376" y1="252.90554669992" x2="497.83628290596" y2="534.81333293569" />
<line x1="9.5576740963376" y1="252.90554669992" x2="564.80762113533" y2="455" />
<line x1="9.5576740963376" y1="252.90554669992" x2="600.44232590366" y2="357.09445330008" />
<line x1="9.5576740963376" y1="252.90554669992" x2="600.44232590366" y2="252.90554669992" />
<line x1="9.5576740963376" y1="252.90554669992" x2="564.80762113533" y2="155" />
<line x1="9.5576740963376" y1="252.90554669992" x2="497.83628290596" y2="75.186667064307" />
<line x1="9.5576740963376" y1="252.90554669992" x2="407.6060429977" y2="23.092213764227" />
<line x1="9.5576740963376" y1="252.90554669992" x2="305" y2="5" />
<line x1="9.5576740963376" y1="252.90554669992" x2="202.3939570023" y2="23.092213764227" />
<line x1="9.5576740963376" y1="252.90554669992" x2="112.16371709404" y2="75.186667064307" />
<line x1="9.5576740963376" y1="252.90554669992" x2="45.192378864669" y2="155" />
<line x1="9.5576740963376" y1="252.90554669992" x2="9.5576740963376" y2="252.90554669992" />
<line x1="9.5576740963376" y1="252.90554669992" x2="9.5576740963376" y2="357.09445330008" />
<line x1="9.5576740963376" y1="252.90554669992" x2="45.192378864668" y2="455" />
<line x1="9.5576740963376" y1="252.90554669992" x2="112.16371709404" y2="534.81333293569" />
<line x1="9.5576740963376" y1="252.90554669992" x2="202.3939570023" y2="586.90778623577" />
<line x1="9.5576740963376" y1="252.90554669992" x2="305" y2="605" />
<line x1="9.5576740963376" y1="357.09445330008" x2="407.6060429977" y2="586.90778623577" />
<line x1="9.5576740963376" y1="357.09445330008" x2="497.83628290596" y2="534.81333293569" />
<line x1="9.5576740963376" y1="357.09445330008" x2="564.80762113533" y2="455" />
<line x1="9.5576740963376" y1="357.09445330008" x2="600.44232590366" y2="357.09445330008" />
<line x1="9.5576740963376" y1="357.09445330008" x2="600.44232590366" y2="252.90554669992" />
<line x1="9.5576740963376" y1="357.09445330008" x2="564.80762113533" y2="155" />
<line x1="9.5576740963376" y1="357.09445330008" x2="497.83628290596" y2="75.186667064307" />
<line x1="9.5576740963376" y1="357.09445330008" x2="407.6060429977" y2="23.092213764227" />
<line x1="9.5576740963376" y1="357.09445330008" x2="305" y2="5" />
<line x1="9.5576740963376" y1="357.09445330008" x2="202.3939570023" y2="23.092213764227" />
<line x1="9.5576740963376" y1="357.09445330008" x2="112.16371709404" y2="75.186667064307" />
<line x1="9.5576740963376" y1="357.09445330008" x2="45.192378864669" y2="155" />
<line x1="9.5576740963376" y1="357.09445330008" x2="9.5576740963376" y2="252.90554669992" />
<line x1="9.5576740963376" y1="357.09445330008" x2="9.5576740963376" y2="357.09445330008" />
<line x1="9.5576740963376" y1="357.09445330008" x2="45.192378864668" y2="455" />
<line x1="9.5576740963376" y1="357.09445330008" x2="112.16371709404" y2="534.81333293569" />
<line x1="9.5576740963376" y1="357.09445330008" x2="202.3939570023" y2="586.90778623577" />
<line x1="9.5576740963376" y1="357.09445330008" x2="305" y2="605" />
<line x1="45.192378864668" y1="455" x2="407.6060429977" y2="586.90778623577" />
<line x1="45.192378864668" y1="455" x2="497.83628290596" y2="534.81333293569" />
<line x1="45.192378864668" y1="455" x2="564.80762113533" y2="455" />
<line x1="45.192378864668" y1="455" x2="600.44232590366" y2="357.09445330008" />
<line x1="45.192378864668" y1="455" x2="600.44232590366" y2="252.90554669992" />
<line x1="45.192378864668" y1="455" x2="564.80762113533" y2="155" />
<line x1="45.192378864668" y1="455" x2="497.83628290596" y2="75.186667064307" />
<line x1="45.192378864668" y1="455" x2="407.6060429977" y2="23.092213764227" />
<line x1="45.192378864668" y1="455" x2="305" y2="5" />
<line x1="45.192378864668" y1="455" x2="202.3939570023" y2="23.092213764227" />
<line x1="45.192378864668" y1="455" x2="112.16371709404" y2="75.186667064307" />
<line x1="45.192378864668" y1="455" x2="45.192378864669" y2="155" />
<line x1="45.192378864668" y1="455" x2="9.5576740963376" y2="252.90554669992" />
<line x1="45.192378864668" y1="455" x2="9.5576740963376" y2="357.09445330008" />
<line x1="45.192378864668" y1="455" x2="45.192378864668" y2="455" />
<line x1="45.192378864668" y1="455" x2="112.16371709404" y2="534.81333293569" />
<line x1="45.192378864668" y1="455" x2="202.3939570023" y2="586.90778623577" />
<line x1="45.192378864668" y1="455" x2="305" y2="605" />
<line x1="112.16371709404" y1="534.81333293569" x2="407.6060429977" y2="586.90778623577" />
<line x1="112.16371709404" y1="534.81333293569" x2="497.83628290596" y2="534.81333293569" />
<line x1="112.16371709404" y1="534.81333293569" x2="564.80762113533" y2="455" />
<line x1="112.16371709404" y1="534.81333293569" x2="600.44232590366" y2="357.09445330008" />
<line x1="112.16371709404" y1="534.81333293569" x2="600.44232590366" y2="252.90554669992" />
<line x1="112.16371709404" y1="534.81333293569" x2="564.80762113533" y2="155" />
<line x1="112.16371709404" y1="534.81333293569" x2="497.83628290596" y2="75.186667064307" />
<line x1="112.16371709404" y1="534.81333293569" x2="407.6060429977" y2="23.092213764227" />
<line x1="112.16371709404" y1="534.81333293569" x2="305" y2="5" />
<line x1="112.16371709404" y1="534.81333293569" x2="202.3939570023" y2="23.092213764227" />
<line x1="112.16371709404" y1="534.81333293569" x2="112.16371709404" y2="75.186667064307" />
<line x1="112.16371709404" y1="534.81333293569" x2="45.192378864669" y2="155" />
<line x1="112.16371709404" y1="534.81333293569" x2="9.5576740963376" y2="252.90554669992" />
<line x1="112.16371709404" y1="534.81333293569" x2="9.5576740963376" y2="357.09445330008" />
<line x1="112.16371709404" y1="534.81333293569" x2="45.192378864668" y2="455" />
<line x1="112.16371709404" y1="534.81333293569" x2="112.16371709404" y2="534.81333293569" />
<line x1="112.16371709404" y1="534.81333293569" x2="202.3939570023" y2="586.90778623577" />
<line x1="112.16371709404" y1="534.81333293569" x2="305" y2="605" />
<line x1="202.3939570023" y1="586.90778623577" x2="407.6060429977" y2="586.90778623577" />
<line x1="202.3939570023" y1="586.90778623577" x2="497.83628290596" y2="534.81333293569" />
<line x1="202.3939570023" y1="586.90778623577" x2="564.80762113533" y2="455" />
<line x1="202.3939570023" y1="586.90778623577" x2="600.44232590366" y2="357.09445330008" />
<line x1="202.3939570023" y1="586.90778623577" x2="600.44232590366" y2="252.90554669992" />
<line x1="202.3939570023" y1="586.90778623577" x2="564.80762113533" y2="155" />
<line x1="202.3939570023" y1="586.90778623577" x2="497.83628290596" y2="75.186667064307" />
<line x1="202.3939570023" y1="586.90778623577" x2="407.6060429977" y2="23.092213764227" />
<line x1="202.3939570023" y1="586.90778623577" x2="305" y2="5" />
<line x1="202.3939570023" y1="586.90778623577" x2="202.3939570023" y2="23.092213764227" />
<line x1="202.3939570023" y1="586.90778623577" x2="112.16371709404" y2="75.186667064307" />
<line x1="202.3939570023" y1="586.90778623577" x2="45.192378864669" y2="155" />
<line x1="202.3939570023" y1="586.90778623577" x2="9.5576740963376" y2="252.90554669992" />
<line x1="202.3939570023" y1="586.90778623577" x2="9.5576740963376" y2="357.09445330008" />
<line x1="202.3939570023" y1="586.90778623577" x2="45.192378864668" y2="455" />
<line x1="202.3939570023" y1="586.90778623577" x2="112.16371709404" y2="534.81333293569" />
<line x1="202.3939570023" y1="586.90778623577" x2="202.3939570023" y2="586.90778623577" />
<line x1="202.3939570023" y1="586.90778623577" x2="305" y2="605" />
<line x1="305" y1="605" x2="407.6060429977" y2="586.90778623577" />
<line x1="305" y1="605" x2="497.83628290596" y2="534.81333293569" />
<line x1="305" y1="605" x2="564.80762113533" y2="455" />
<line x1="305" y1="605" x2="600.44232590366" y2="357.09445330008" />
<line x1="305" y1="605" x2="600.44232590366" y2="252.90554669992" />
<line x1="305" y1="605" x2="564.80762113533" y2="155" />
<line x1="305" y1="605" x2="497.83628290596" y2="75.186667064307" />
<line x1="305" y1="605" x2="407.6060429977" y2="23.092213764227" />
<line x1="305" y1="605" x2="305" y2="5" />
<line x1="305" y1="605" x2="202.3939570023" y2="23.092213764227" />
<line x1="305" y1="605" x2="112.16371709404" y2="75.186667064307" />
<line x1="305" y1="605" x2="45.192378864669" y2="155" />
<line x1="305" y1="605" x2="9.5576740963376" y2="252.90554669992" />
<line x1="305" y1="605" x2="9.5576740963376" y2="357.09445330008" />
<line x1="305" y1="605" x2="45.192378864668" y2="455" />
<line x1="305" y1="605" x2="112.16371709404" y2="534.81333293569" />
<line x1="305" y1="605" x2="202.3939570023" y2="586.90778623577" />
<line x1="305" y1="605" x2="305" y2="605" />
</svg>

Mario

Posted 2016-12-01T17:43:25.683

Reputation: 3 043

0

R, 108 bytes

plot(x<-cos(t<-seq(0,2*pi,l=21)),y<-sin(t),as=1);apply(expand.grid(1:21,1:21),1,function(e)lines(x[e],y[e]))

Could shave 5 bytes off if I got rid of argument ,as=1 which forces an aspect ratio of 1. Uses expand.grid to create a matrix with all possible pair of points, and uses apply to loop through it.

N=21

R + igraph, 87 bytes

Another solution using package igraph.

library(igraph);plot(make_full_graph(21),layout=cbind(cos(t<-seq(0,2*pi,l=21)),sin(t)))

N=21

plannapus

Posted 2016-12-01T17:43:25.683

Reputation: 8 610