Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I reproduce a scribbly pattern like this in code?
    primarykey
    data
    text
    <p>I made this graph in wolfram alpha by accident:</p> <p><img src="https://i.stack.imgur.com/5elU2.gif" alt="Graph"></p> <p><strong>Can you write code to produce a larger version of this pattern?</strong></p> <p><strong>Can you make similar looking patterns?</strong> </p> <p>Readable code in any language is good, but something that can be run in a browser would be best (i.e. JavaScript / Canvas). If you write code in other languages, please include a screenshot.</p> <p>Notes:</p> <ul> <li>The input formula for the above image is: arg(sin(x+iy)) = sin^(-1)((sqrt(2) cos(x) sinh(y))/sqrt(cosh(2 y)-cos(2 x))) (<a href="http://www.wolframalpha.com/input/?i=arg%28sin%28x%2Biy%29%29+%3D+sin%5E%28-1%29%28%28sqrt%282%29+cos%28x%29+sinh%28y%29%29%2Fsqrt%28cosh%282+y%29-cos%282+x%29%29%29" rel="nofollow noreferrer">link</a>)</li> <li>You don't have to use to use the above formula. Anything which produces a similar result would be cool. But "reverse engineering" Wolfram Alpha would be best</li> <li>The two sides of the equation are equal (I think), So WA should have probably only returned 'true' instead of the graph</li> <li>The pattern is probably the result of rounding errors.</li> <li>I don't know if the pattern was generated by iterating over every pixel or if it's vector based (points and lines). My guess is with vector.</li> <li>I don't know what causes this type of pattern ('Rounding errors' is the best guess.)</li> <li>IEEE floating point standard does not say how sin or cos, etc should work, so trig functions vary between platforms and architectures.</li> <li>No brownian motion plots please</li> </ul> <p>Finally, here's another example which might help in your mission: (<a href="http://www.wolframalpha.com/input/?i=arg%28sin%28x%2Biy%29%29+%3D+tan%5E%28-1%29%28cot%28x%29+tanh%28y%29%29" rel="nofollow noreferrer">link</a>)</p> <p><img src="https://i.stack.imgur.com/BGp14.gif" alt="Graph 2"></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload