[Question]
  [
In mathematics, a *cyclic quadrilateral* is one whose vertices all lie on the same circle. In other words, every vertex is on the circumcircle of the other three. For more information, see the [MathWorld article](http://mathworld.wolfram.com/CyclicQuadrilateral.html).
### Examples
These quadrilaterals are cyclic:
[![Cyclic quadrilaterals](https://i.stack.imgur.com/1t0IX.png)](https://i.stack.imgur.com/1t0IX.png)
This trapezoid is not cyclic.
[![Trapezoid](https://i.stack.imgur.com/K3hYA.png)](https://i.stack.imgur.com/K3hYA.png)
(Images from Wikipedia)
### Objective
Given the coordinates of four vertices in counterclockwise order which form a convex quadrilateral, determine if the quadrilateral is cyclic.
Coordinates will be integers (note, however, that the circumcenter coordinates and circumradius are not necessarily integers.) As implied by the previous paragraph, no three points will be co-linear and no two coincident.
### I/O
You may take input using any reasonable format. In particular, `[[x1,x2,x3,x4],[y1,y2,y3,y4]]`, `[[x1,y1],[x2,y2],[x3,y3],[x4,y4]]` and complex numbers are all fine.
Output using any different consistent values for true and false.
### Test cases
True:
```
[0,0], [314,0], [314,1], [0,1]
[-5,5], [5,-5], [1337,42], [42,1337]
[104, -233], [109, -232], [112, -231], [123, -224]
```
False:
```
[0,0], [314,0], [314,100], [0,99]
[31,41],[59,26],[53,58],[0,314]
```
  
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), 23 bytes
```
#∈Circumsphere@{##2}&
```
[Try it online!](https://tio.run/##dY4xCsMwDEX3nMIQ6OSAJdltsxl6ge6lQwiBZEgpqTsZ7zlnL@LKwkOXTnrfPH1rHcI8rUNYxiFft@URbrn97Ptl2cb3@nrO0zb52LaYDtl7r2ITo9HKJK0igf0lKGTKZGCtc1q58sazEwCik1YWC1tkk3OVwXBDh0TimV6CiAAoQeoBqQS0de3fKcbUY/q@mgT8s3Q4LsejEJe5czV5MaUm3fMX "Wolfram Language (Mathematica) – Try It Online")
Takes four inputs: the lists `{x1,y1}`, `{x2,y2}`, `{x3,y3}`, and `{x4,y4}`. Checks if the first point lies on the circumcircle of the other three. Also works for checking if \$n+1\$ points in \$\mathbb R^n\$ are concyclic, provided the last \$n\$ of them are affinely independent (because `Circumsphere` is sad if you give it a degenerate input).
Alternatively, here is a mathematical approach:
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), ~~29~~ ~~28~~ ~~25~~ 24 bytes
```
Det@{#^2+#2^2,##,1^#}^0&
```
[Try it online!](https://tio.run/##dY0xCwIxDIX3@xWFgos9aJJW7dbBH@AuFooceMM5SLfS316Ts6vweJCX7yVbLq9ly2V95n77rO9y79elxKoTHjUmNFobSLole@gxRlWnWq1RBG6YbUZJwgJW45GR2RvFAqKzUQ6F4VFSh794gGD5BtjABrJBEnZGIsaRcHcQRzcqf99bthAGJSXPZz0NyHGAJw4ue7W1qT36Fw "Wolfram Language (Mathematica) – Try It Online")
Takes two lists as input: `{x1,x2,x3,x4}` and `{y1,y2,y3,y4}`. Returns `Indeterminate` when the four points are on a common circle, and `1` otherwise.
From the four points \$(x\_1, y\_1), (x\_2,y\_2), (x\_3, y\_3), (x\_4, y\_4)\$, this solution constructs the matrix below:
\$\begin{bmatrix}x\_1^2 + y\_1^2 & x\_2^2 + y\_2^2 & x\_3^2 + y\_3^2 & x\_4^2 + y\_4^2 \\ x\_1 & x\_2 & x\_3 & x\_4 \\ y\_1 & y\_2 & y\_3 & y\_4 \\ 1 & 1 & 1 & 1 \end{bmatrix}\$
The determinant of this matrix is 0 if and only if the four rows are linearly dependent, and a linear dependency between the rows is the same thing as the equation of a circle that's satisfied at all four points.
The shortest way I could think of to check if the determinant is 0 is to raise it to the 0-th power: `0^0` is `Indeterminate` while anything else gives `1`.
[Answer]
# [Python 3](https://docs.python.org/3/), 70 bytes
```
lambda b,c,d,e,a=abs:a(a(b-d)*a(c-e)-a(b-c)*a(d-e)-a(c-d)*a(b-e))<1e-8
```
[Try it online!](https://tio.run/##nY/LDoIwEEX3fEWXrWmTTgsKRv7ETVsgmvCKstCvxynEZDCsXJ7T5s6943u6Db2dm/I6t67zlWNeBlnJWrrS@efZcce9qsTB8aBqoSKFSNVKYX3zSOICtcrn8XHvJ97wMHRjW7@4lkwLyb5oId0RQISOKETyG6QyyTLyD1FRBmtPkqWGqNRgFuq9ONB4VxlraYQuFkczAMziaEUwNjqTxuAk@W@y1tvRRbFX0wJuorczrGiOVGCXLN9m4YWl2vwB "Python 3 – Try It Online")
I use the [Ptolemy's theorem](https://en.wikipedia.org/wiki/Ptolemy%27s_theorem). 
> 
> In a quadrilateral, if the sum of the products of its two pairs of
>  opposite sides is equal to the product of its diagonals, then the
>  quadrilateral can be inscribed in a circle.
> 
> 
> 
`b`, `c`, `d`, `e` are complex numbers. 
[Answer]
# [Perl 6](https://github.com/nxadm/rakudo-pkg), 44 bytes
```
{!im ($^b-$^a)*($^d-$^c)/(($d-$a)*($b-$c)):}
```
[Try it online!](https://tio.run/##bY3BCsIwDIbve4oKRVq7YpO00wq@ymROBwOHMk9Dffaa9uDJS/4v@f8kj@t8a9K0iPUgjum1GiehZHu2su30hunC1OutUpKpjNjrtT580rNbxKDe8qTFcJ8r5Ywba0HgfwqsjquuK2WDCdwGmysQ7YxHJo8mNyUCzlskyr6LTNkHQKZ8CJAsoi/JP6@cK89iLAEC4/NSiAabrGTCvgQ4POr0BQ "Perl 6 – Try It Online")
Takes vertices as complex numbers. Uses the fact that the sum of opposite angles is 180° in a cyclic quadrilateral. The order of operations should guarantee that floating-point operations yield an exact result for (small enough) integers.
### Port of Misha Lavrov's TI-Basic solution, 33 bytes
```
{![*](map */*,($_ Z-.rotate)).im}
```
[Try it online!](https://tio.run/##bY3NCsIwEITvfYoIIvlpanaTVHPwPUQR6cFCwNJSeynis8dNDp68zMzCtzPTY362aVjZrmen9N5c5Y0P3cTkXtZ8e2cX3czj0i0PIZo4fNKrW1nPG8IE68e54kaZWDML7udAbkhFXXHtlafT66xg7UE5pORQ5SOys6QXHzIKxmm0NnMmUMocAFLKhYBWI7pS@mfSmDIaQgEsKJeffFDYZrfKHwtAcBTpCw "Perl 6 – Try It Online")
[Answer]
# JavaScript (ES6)
## Testing the angles, 114 bytes
Takes input as the array \$[x1,y1,x2,y2,x3,y3,x4,y4]\$. Returns a Boolean value.
```
a=>(F=i=>(A=Math.atan2)(a[i+3&7]-(y=a[i+1]),a[i+2&7]-a[i])-A(a[i+5&7]-y,a[i+4&7]-a[i]))(0)+F(2)+F(4)+F(6)==Math.PI
```
[Try it online!](https://tio.run/##jU49C8IwEN37KzpJQhtJLqnaIYKL4CC4lw5BW61II1oEf329S1FBOgj38XL37r2c3cPd97fm2onWH6q@tr2zS7a2DdaV3bruNHWda4EzVzSJnsxLwZ6WsCp5Sh1ohqDkYhVIGQ2eYWc@O84kT9YMqBgqM24H@d2m3/v27i/V9OKPrGaFTGMMrcy3qwDRkkc/ZJGl8RCElNbzNDYwJL1GTpRERQFaI0PmARJZQYBopUATBEPH0R@/k8Mwz0fcSNBgZugEM@yonS3ex3jQvwA "JavaScript (Node.js) – Try It Online")
---
## Computing a determinant, 130 bytes
Takes input as \$[x1,x2,x3,x4]\$ and \$[y1,y2,y3,y4]\$ in currying syntax. Returns a Boolean value.
This one is equivalent to [MishaLavrov's 2nd answer](https://codegolf.stackexchange.com/questions/176162/is-this-quadrilateral-cyclic/176174#176174), with a rotated matrix.
```
x=>y=>!(g=a=>a+a?a.reduce((v,[r],i)=>v+(i&1?-r:r)*g(a.map(r=>r.slice(1)).filter(_=>i--)),0):1)(x.map((X,i)=>[1,Y=y[i],X,X*X+Y*Y]))
```
[Try it online!](https://tio.run/##dZDdaoQwFITv@xT2puRoIvnRti4k@xqKSAmuSopdl7iV3ae3J3avioVhIMM3k5BPu9i59e5yZefp1K29Xm/a3LV5JoO22tjEHm3qu9N32xGy0No31IE2S0Lcizgyf/AQD8SmX/ZCvDY@nUeHqABIezdeO08@tHGMAVAOBwHktqGk3GZqQSt9r11DS1rGZVLFVQOwttN5nsYuHaeB9KTmNFIiexhvYEtQAoX40x@c5TRCCaXeaJTJwOMxpJn8jXdKguO24AWaCJRUocekUliVSm4ugstsp/7vEzlaUew0wliO1@XqUcgwkK8YvG8z4R9@AA "JavaScript (Node.js) – Try It Online")
[Answer]
# TI-Basic (83 series), 21 bytes
```
e^(ΔList(ln(ΔList(augment(Ans,Ans
not(imag(Ans(1)Ans(3
```
Takes input as a list of four complex numbers in `Ans`. Returns `1` if the quadrilateral is cyclic and `0` otherwise.
This is [nwellnhof's cross-ratio computation](https://codegolf.stackexchange.com/a/176171), in heavy disguise. If we start with values \$z\_1, z\_2, z\_3, z\_4\$, then:
* `ΔList(augment(Ans,Ans` computes the differences \$z\_2-z\_1, z\_3-z\_2, z\_4-z\_3, z\_1-z\_4\$ (and a few more redundant terms),
* `e^(ΔList(ln(` of that computes the ratios \$\frac{z\_3-z\_2}{z\_2-z\_1}, \frac{z\_4-z\_3}{z\_3-z\_2}, \frac{z\_1-z\_4}{z\_4-z\_3}, \dots\$.
* We check if the product of the first and third terms, which is \$\frac{z\_3-z\_2}{z\_2-z\_1} \cdot \frac{z\_1-z\_4}{z\_4-z\_3}\$, has no imaginary part. Note that this is the same as the [cross-ratio](https://en.wikipedia.org/wiki/Cross-ratio) \$(z\_3,z\_1;z\_2,z\_4) = \frac{z\_2-z\_3}{z\_2-z\_1} : \frac{z\_4-z\_3}{z\_4-z\_1}\$.
I did my best to check if numerical error is a problem, and it doesn't seem to be, but if anyone has good test cases for that, please let me know.
[Answer]
### JavaScript (ES6) (101 bytes)
```
p=>(h=(a,b)=>Math.hypot(p[a]-p[b],p[a+1]-p[b+1]))&&((h(2,4)*h(0,6)+h(0,2)*h(4,6)-h(0,4)*h(2,6))<1e-8)
```
Takes input as `[x1,y1,x2,y2,x3,y3,x4,y4]`, outputs a Boolean.
Checked based on $$ef=ac+bd$$ where \$e,f\$ are the diagonals and \$a,b,c,d\$ are the sides in order.
[Try it online!](https://tio.run/##jU7BqsIwELz7FT3JRhNJNqlasP6BX1A8RF/78kRM0CL49XU3RQTx8GCXmUl2dvbk7/52vP6lXl3iTzt09ZDqLYQavDyIervzfViER4o9pMbvVWoOe0lsbjInEGI6BQiA0olZAC2XYs6ArBwpxSr/ISmxMa1ai@EYL7d4bhfn@AsdNFoWVNa4N5pMOWDyMaxKWYzFzFi7koXDsVl9sRhNGxVaSxO6ypSHDWZKUQYtU3RsnvzjOj0@VtWXNF7oqEtKwiUh7S7XLzMZhic "JavaScript (Node.js) – Try It Online")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 11 bytes
```
²Sṭ;L€€ṖÆḊ¬
```
[Try it online!](https://tio.run/##bU4xDsIwDNz7CnY3ku0k0IgvsLFRdWSg4gOsDEXiAbyiLEx0bV9SPhLsqq2EihTdOXeXc8rj@XyJsX3t@@a53X2utZy@eXRV/763deyq00GU7iYQY54jYJmuLLmZSRgFizTJ/@mKOLu/6tSk7lKdetQ1HrwI3iiStRtwLJNj0MsQIXSGrVUfg0zqE7FMWkxsDbMbVy2WIA7LQxh/Ck4f@QC8VrbgsyEg4bJIikjZFw "Jelly – Try It Online")
Uses the determinant approach from [Misha Lavrov's Mathematica solution](https://codegolf.stackexchange.com/a/176174/78410). Outputs 1 for true, 0 for false.
### How it works
```
²Sṭ;L€€ṖÆḊ¬  Main link (monad). Input: [[x1,x2,x3,x4], [y1,y2,y3,y4]]
²S           Square each scalar and add row-wise; [x1*x1+y1*y1, ...]
  ṭ          Append to the input
   ;L€€      Add two rows of [1,1,1,1]'s
       Ṗ     Remove an extra row
        ÆḊ¬  Is the determinant zero?
```
# [Jelly](https://github.com/DennisMitchell/jelly), 12 bytes
```
Iµ÷×ƭ/÷SµḞ=A
```
[Try it online!](https://tio.run/##bU4xDsIwDNz7CnY3wnYSaAYGRmbGqiNL1Q@wsvAENl4AY1XmRuIf8JFgV20lBMudc2ffpT40zTGlXd/GLl6e92Xs9n37elw32xTP79MtpbJEwDpfWHIzkzAKVnlW/tMVcXa/1SlJ3V91ylHXePAieKNI1q7BsUyOQR/DCqEzbK36GGRSn4hl0mBia5jdWPVTgjiUhzD@FJwe@QC8Urbgi2FBlusqqxIVHw "Jelly – Try It Online")
Uses the convoluted cross-ratio approach from [Misha Lavrov's TI-Basic solution](https://codegolf.stackexchange.com/a/176192/78410). Outputs 1 for true, 0 for false.
### How it works
```
Iµ÷×ƭ/÷SµḞ=A  Main link (monad). Input: list of four complex numbers [z1,z2,z3,z4]
I             Increments; [z2-z1, z3-z2, z4-z3]
 µ            Refocus on above for sum function
  ÷×ƭ/÷S      (z2-z1)÷(z3-z2)×(z4-z3)÷(z4-z1)
        µ     Refocus again
         Ḟ=A  (real part) == (norm) within error margin
              i.e. imag part is negligible?
```
I believe both are golfable...
[Answer]
# [APL (Dyalog Classic)](https://www.dyalog.com/), 25 bytes
```
{0=-/|⍵}(-⌿2 3⍴2/⌽)×⊃-1↓⊢
```
[Try it online!](https://tio.run/##XY29agJREEb7fYrpVouL83NvzAZ8mMWwwZsFRW1CYhURNC4EUlgnL5BGG0EC@ibzIpvZxcpiZg5zPvjySekeX/Jy/OSGZT6bjYZ1Xejq8xUHrvem1WHRcbr9YxCt9tzT7al72enm3ZGuvnTzU9fzJm1BXX9PDQutjg/p@DnVj2Va5KMytYfp6SLBiCDkr5sAbeZAyfk3xAAh2gUS6UfP4Dk22HpCb45FgDBriYGIWyIglobYt9mbDkRryTJTmAhFTxCyyHcQJIZ7UxZq3D8 "APL (Dyalog Classic) – Try It Online")
Ptolemy's theorem, credit: [Кирилл Малышев's answer](https://codegolf.stackexchange.com/a/176167/24908)
]