Calculate the internal angles of a regular polygon with N sides

Perl 6, 8 bytes

π- τ/*

Try it online!

Output in radians. Simple function in WhateverCode notation which computes \$π-τ/n\$. \$τ\$ is the constant tau equaling \$2π\$.


Python 3, 18 bytes

lambda s:180-360/s

An unnamed function which returns a floating point number of degrees. (For gradians swap 180 for 200 and 360 for 400.)

Try it online!


JavaScript, 12 bytes

n=>180-360/n

Try it Online!

Tags:

Code Golf