65 votes

The Pedant's Cosine

Operation Flashpoint scripting language, 165 157 bytes ...
Steadybox's user avatar
  • 16.5k
24 votes

Draw a graph of \$y=(-n)^x\$

TI-Basic, 26 21 bytes ~3→Xmin 3→Xmax Prompt N DrawF N^Xcos(πX Output for N=2:
Timtech's user avatar
  • 12.5k
23 votes

A single pixel moving in a circular path

Processing, 101 97 96 bytes 4 bytes thanks to Flambino. 1 byte thanks to Kritixi Lithos. ...
PurkkaKoodari's user avatar
22 votes

Black Box Trigonometry

Python 3.6.4 on Linux, 99 bytes Bit of a silly answer, but: lambda f:"asinh acos cos cosh atan atanh tan sin asin tanh sinh acosh".split()[hash(f(.029))%19%12] ...
orlp's user avatar
  • 39k
21 votes

Find the angle between two points

TI-BASIC, 13 bytes For TI-83+/84+ series calculators. Degree Input Y min(ΔList(R►Pθ(Ans,∟Y To use this program, enter the list ...
lirtosiast's user avatar
  • 21.4k
18 votes

Perimeter of Conway hexagon

Python 3, 89 87 69 68 bytes Thanks @xnor for finding a shorter expression, saving 1 byte! f=lambda a,b,c,n=3:n and(a+b+c)*(c*c/a/b-a/b-b/a+2)**.5+f(b,c,a,n-1) Try ...
Surculose Sputum's user avatar
17 votes

Finding Exclusive Area in Circle Intersections

Python 2, 631 bytes ...
Ell's user avatar
  • 7,677
16 votes

A single pixel moving in a circular path

QB64, 79 bytes QB64 is a QBasic emulator that adds some nice features. This program uses one (CLS,15) that isn't supported by vanilla QBasic. ...
Lynn's user avatar
  • 68.1k
15 votes

Draw a graph of \$y=(-n)^x\$

Bash + Gnuplot, 56 45 bytes (-11 bytes thanks to Noiralef!) gnuplot -e "se t png;p[-3:3]real((-$1)**x)">A Saves the resulting graph as a ...
R. Kap's user avatar
  • 4,918
14 votes

A single pixel moving in a circular path

Java, 449 443 439 bytes Because I've always had stupid ideas. Like golfing in Java ;) . ...
Peter Lenkefi's user avatar
14 votes

A single pixel moving in a circular path

HTML, 235 290 295 354 347 bytes ...
insertusernamehere's user avatar
14 votes

A single pixel moving in a circular path

TI-BASIC, 44 bytes For the TI-84+ CSE/CE calculators, which support some limited BASIC color graphics. ...
lirtosiast's user avatar
  • 21.4k
14 votes

Print cos(2π/17) exactly

CJam (60 bytes) 1-4{"(- +sqrt( * -4* ))/2"S/@a*N/\a*}:F~'-\+WF'-\+W-4FWFF'/2 Online demo Output (with added newlines to avoid wrapping): ...
Peter Taylor's user avatar
  • 43.1k
14 votes

Draw a graph of \$y=(-n)^x\$

Python 3 with matplotlib, 103 72 bytes -12 bytes thanks to DSM (a module is installed alongside matplotlib called pylab with ...
Jonathan Allan's user avatar
13 votes

A single pixel moving in a circular path

Mathematica, 102 101 94 bytes Animate[Graphics[{White,Disk[],{Purple,Point[{0,1}]}}~Rotate~-t],{t,0,2π},DefaultDuration->60] Creates a white circle that is ...
tjq's user avatar
  • 131
13 votes

A single pixel moving in a circular path

Java, 339 308 289 287 bytes ...
Franz D.'s user avatar
  • 231
13 votes

The Pedant's Cosine

05AB1E, 14 11 bytes FIn(NmN·!/O Try it online! Explanation ...
Emigna's user avatar
  • 52.9k
12 votes
Accepted

Find the angle between two points

Pyth, 11 bytes .t-FPM.jMQ6 Demonstration Input is given in the format: [[Bx, By], [Ax, Ay]] If it is desired that A comes ...
isaacg's user avatar
  • 42k
12 votes

Draw a graph of \$y=(-n)^x\$

Mathematica, 41 bytes Plot[Re[(-#)^x],{x,-3,3},PlotRange->All]& Output looks exactly as shown in the challenge except for the font of the numbers (which I ...
Martin Ender's user avatar
12 votes
Accepted

Draw a graph of \$y=(-n)^x\$

MATL, 22 18 16 bytes Thanks @LuisMendo for additional -2 bytes! ...
flawr's user avatar
  • 43.7k
12 votes

Draw a graph of \$y=(-n)^x\$

R, 29 bytes curve(Re((0i-scan())^x),-3,3) n is provided through stdin. Result for n=1: And for n=2:
plannapus's user avatar
  • 8,899
12 votes

Perimeter of Conway hexagon

Python 3, 64 bytes lambda*t:eval("+((-(%s-%s)**2+%s**2)/%s/%s)**.5"*3%(t*5))*sum(t) Try it online! Uses an adaptation of a formula by Surculose Sputum, written ...
xnor's user avatar
  • 144k
11 votes

Write a Sine-Deriving Machine

Python, 42 bytes from math import* lambda x,n:sin(x+pi/2*n) Uses the fact that differentiating shifts the function by pi/2 ...
xnor's user avatar
  • 144k
11 votes

Draw a graph of \$y=(-n)^x\$

MATLAB, 35 30 bytes x=-3:.01:3;@(n)plot(x,(-n).^x) This defines an anyonmous function. The output is via a new window with a resizable vector graphic output. ...
flawr's user avatar
  • 43.7k
11 votes

Are my triangles similar?

MATL, 15 12 bytes ,i4:)d|S]/da The program inputs two 3×1 vectors of complex numbers representing the coordinates; and outputs ...
Luis Mendo's user avatar
  • 104k
11 votes

Integers in cosine

Wolfram Language (Mathematica), 25 bytes This uses a trick: Mathematica doesn't expand Sin[51819] into a proper number even when ...
the default.'s user avatar
  • 8,415
10 votes

Find the angle between two points

CJam, 14 bytes q~::ma:-P/180* This is a full program that reads the input as [[Ax Ay] [Bx By]] from STDIN. Try it online in ...
Dennis's user avatar
  • 210k
10 votes

Draw a graph of \$y=(-n)^x\$

R, 30 bytes plot(Re((0i-n)^seq(-3,3,.05))) n = 1 n = 2
Konrad Rudolph's user avatar
10 votes

Draw a graph of \$y=(-n)^x\$

Excel VBA, 168 160 147 138 Bytes (cells as pixels at 100x scale) Saved 8 bytes thanks to KyleKanos Saved 22 bytes thanks to Taylor Scott ...
Engineer Toast's user avatar
10 votes

The Pedant's Cosine

Mathematica, 49 41 39 31 bytes Sum[(-#^2)^k/(2k)!,{k,0,#2-1}]& Old, more "fun" version: (39 bytes) ...
GamrCorps's user avatar
  • 7,502

Only top scored, non community-wiki answers of a minimum length are eligible